home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VGADOC4B.ZIP / ATI.TXT < prev    next >
Text File  |  1995-09-29  |  137KB  |  2,708 lines

  1.    ATI Technologies Super VGA Chip Sets.
  2.  
  3.     18800              V3. ROM BIOS label: V3M
  4.     18800-1    100pin  V4. ROM BIOS label: V4M
  5.     18800-1    100pin  V5. Uses 18810 Dot Clock Chip. ROM BIOS label: V5M
  6.     28800-2            V6. VGA Wonder+
  7.     28800-4            V7. VGA Wonder XL
  8.     28800-5            VGA Wonder (1MB)/XL, Graphics/Ultra (VGA chip)
  9.     28800-6    160pin  VGA Wonder XL24
  10.     38800-1            Mach 8.  8514/Ultra and Graphics/Ultra (8514/A chip)
  11.     68800-3    208pin  Mach 32. Graphics Ultra Pro/+ Combined 8514/A and
  12.                           VGA chip.
  13.     68800-6    208pin  As -3, but with memory mapped registers
  14.     68800-LX   208pin  As -6, but only supports DRAM (no VRAM)
  15.     68800-AX   208pin  As -6, but supports PCI bus
  16.     88800GX    208pin  Mach64 (there is also an 88800CX ??)
  17.  
  18. Support chips:
  19. ATI18810  Clock chip for 18800-1, 28800
  20. ATI18811  Clock chip for 68800
  21. ATI18820  Bus Mouse Controller
  22.  
  23.     ATI Prism Elite uses Trident 8800CS chips.
  24.  
  25.     ATI VGA Wonder XL can use the Sierra HiColor RAMDAC.
  26.  
  27. Note that the base register for the ATI extended registers should be read from
  28. the word at 0C000h:10h (NOT on Mach64), as ATI reserves the right to change
  29. the base address. However all current implementations use 1CEh.
  30.  
  31. Note:  The ATI chips handles the indexed registers slightly differently
  32.        from other VGA chips, as the index register must be written before
  33.        each read or write of the associated data register.
  34.  
  35.  
  36. 1CEh index 80h (R/W):  ATI Register 0 (ATI00)                     (68800 only)
  37. bit  0-7  Scratch Pad
  38.  
  39. 1CEh index 81h (R/W):  ATI Register 1 (ATI01)                     (68800 only)
  40. bit  0-7  Scratch Pad
  41.  
  42. 1CEh index 82h (R/W):  ATI Register 2 (ATI02)                     (68800 only)
  43. bit  0-7  Scratch Pad
  44.  
  45. 1CEh index 83h (R/W):  ATI Register 3 (ATI03)                     (68800 only)
  46. bit  0-7  Scratch Pad
  47.  
  48. 1CEh index 84h (R/W):  ATI Register 4 (ATI04)                     (68800 only)
  49. bit  0-7  Scratch Pad
  50.  
  51. 1CEh index 85h (R/W):  ATI Register 5 (ATI05)                     (68800 only)
  52. bit  0-3  CPUCLK Select. Selects the number of CPU clocks for the basic
  53.           command cycle in the local bus.
  54.      4-5  Delay Memory Read Ready Control.
  55.            0: Read Ready signal is 1 MCLK before memory data is available
  56.            1: Read Ready signal is simultaneously with the memory data.
  57.            2: Read Ready signal is 1 MCLK after memory data is available
  58.            3: Read Ready signal is 2 MCLKs after memory data is available
  59.        6  Delay latch memory read data by one half memory clock cycle in VGA
  60.           planar mode.
  61.        7  Cursor Blink Rate Select. Half normal rate if set.
  62.  
  63. 1CEh index 86h (R/W):  ATI Register 6 (ATI06)                     (68800 only)
  64. bit  0-2  Text mode character FIFI depth
  65.      4-6  Number of CPUCLK cycles in the local bus BIOS ROM read cycle.
  66.  
  67. 1CEh index A0h (R/W):  ATI Register 20 (ATI20)                       (28800 +)
  68. bit  0-3  (68800 only) Display FIFO. Selects the video FIFO depth where the
  69.            Display Request changes from low to high priority in the memory
  70.            controller. Default is 8
  71.        4  Enable 16bit ROM if set
  72.      5-6  (68800 only) RAMDAC Extended Address Select. Connected to RS2 and
  73.            RS3 on the RAMDAC, giving access to all 8 or 16 registers on
  74.            advanced RAMDACs.
  75.  
  76. 1CEh index A1h (R/W):  ATI Register 01h                              (28800 +)
  77. bit  0-2  Reserved
  78.      3-4  Digital Monitor Detection
  79.      5-7  Reserved
  80.  
  81. 1CEh index A2h (R/W):  ATI Register 02h                              (28800 +)
  82. bit  0-7  Reserved
  83.  
  84. 1CEh index A3h (R/W):  ATI Register 23 (ATI23)                       (28800 +)
  85. bit  0-2  16bit ROM Access. ROM access time (Single 16bit ROM).
  86.        3  Cursor Start Address bit 17. Bit 17 of the Cursor Start Address
  87.            (3d4h index 0Eh,0Fh) Bit 16 is in
  88.        4  Display start address bit 17. Bit 17 of the Display Start Address
  89.            (3d4h index 0Ch,0Dh). Bit 16 is in 1CEh index B0h bit 6.
  90.      5-7  Reserved
  91.  
  92. 1CEh index A4h (R/W):  ATI Register 24 (ATI24)                       (28800 +)
  93. bit  0-3  ROM page 0
  94.      4-7  ROM page 1
  95.  
  96. 1CEh index A5h (R/W):  ATI Register 25 (ATI25)                       (28800 +)
  97. bit  0-3  ROM page 2
  98.      4-7  ROM page 3
  99.  
  100. 1CEh index A6h (R/W):  ATI Register 26 (ATI26)                       (28800 +)
  101. bit    0  (68800) Display Enable Skew-by-2. If set skews the "Display Enable"
  102.             signal by 2 character clocks.
  103.        3  (68800) General Purpose R/W Bit.
  104.        6  (68800) Solid Underline. Set for solid underline in monochrome text,
  105.             clear for dashed underline.
  106.        7  Forced read 3CCh. If set forces GENMO[1-7] to 0 while reading 3CCh
  107.  
  108. 1CEh index A7h (R/W):  ATI Register 07h                              (28800 +)
  109. bit    0  Enable True color mode
  110.      1,3  True Color DAC installed
  111.        2  Reserved
  112.      4-5  Forced pixel data to high
  113.        6  Skew display enable
  114.        7  Enable divide by 3 clock
  115.  
  116. 1CEh index A8h (R):  ATI Register 28 (ATI28)                     (28800-5 +)
  117. bit  0-1  Vertical Line Counter bit 8-9
  118.      2-7  Reserved
  119.  
  120. 1CEh index A9h (R):  ATI Register 29 (ATI29)                     (28800-5 +)
  121. bit  0-7  Vertical Line Counter bit 0-7
  122. Note: The VGA Wonder documents A8h as the low byte and A9h as the high byte,
  123.       but at least for the 28800-6 and Mach32 A8h IS the low byte.
  124.  
  125. 1CEh index AAh (R/W):  ATI Register 0Ah                            (28800-5 +)
  126. bit  0-3  (R) Chip Revision ID. 6 for the 28800-6, (5 for the 28800-5 ??)
  127.        4  Address/Data bus configuration
  128.      5-7  Reserved
  129.  
  130. 1CEh index ABh (R/W):  ATI Register 2B (ATI2B)                       (28800 +)
  131. bit    0  Video Zero Wait-State Enable. Enables zero wait state support for
  132.           video memory write if set
  133.        1  BIOS Zero Wait-State Enable. Enables zero wait state for BIOS read
  134.           if set
  135.        2  (68800) I/O Zero Wait State Enable if set
  136.        3  Select secondary display
  137.           (68800) Double Scan Lock Enable. Locks 3d4h index 9 bit 7 if set
  138.        4  (28800-6 +) Lock DAC write. If set locks the RAMDAC write signal
  139.        5  (28800-6) Zero wait state enable
  140.        6  Restrict CPU access
  141.           (68800) Memory Data Delay Latch in Text Mode. If set latching of
  142.            memory data from the DRAM port is delayed by 1/2 MCLK in text modes
  143.        7  Video Data Delay Latch in Text Mode. If set internal latching of
  144.           video data from the serial port is delayed by 1/2 MCLK in text modes
  145.  
  146. 1CEh index ACh (R/W):  ATI Register 0Ch                            (28800-6 +)
  147. bit    0  Enable Linear Addressing
  148.      1-5  Reserved
  149.        6  Enable 1024x768x16 color planar pass through internal palette
  150.        7  Reserved
  151.  
  152. 1CEh index ADh (R/W):  ATI Register 2D (ATI2D)                     (28800-6 +)
  153. bit    0  (28800-6) Extended Horizontal Total bit 8. Bits 0-7 are in 3d4h
  154.              index 0. Only used if bit 3 is set
  155.        1  (28800-6) Extended CRTC Start Blanking bit 8. Bits 0-7 are in 3d4h
  156.              index 2. Only used if bit 3 is set
  157.      0-1  (68800) Extended Cursor Address. Bits 18-19 of the Cursor Address
  158.            register (3d4h index 0Eh,0Fh). Bit 16 is in 1CEh index B0h bit 2
  159.            and bit 17 in 1CEh index A3h bit 3.
  160.        2  (28800-6) Extended CRTC Horizontal Retrace Start bit 8. Bits 0-7 are
  161.            in 3d4h index 4. Only used if bit 3 is set
  162.        3  (28800-6) Extended CRTC Registers Enable
  163.      2-3  (68800) Extended Start Address. Bits 18-19 of the Display Start
  164.            Address register (3d4h index 0Ch,0Dh). Bits 16 is in 1CEh index B0h
  165.            bit 6 and bit 17 in 1CEh index A3h bit 4
  166.      4-7  Extended Character Map Address. Bits 16-19 of the address where the
  167.           font maps are stored. See 3C4h index 3.
  168.  
  169. 1CEh index AEh (R/W):  ATI Register 2E (ATI2E)                  (68800 only?)
  170. bit  0-1  (68800) Write/Single bank bit 4-5
  171.      2-3  (68800) Read bank bit 4-5
  172.        4  If sets locks the CPUCLK select bits (1CEh index 85h bits 0-3).
  173.      5-7  Horizontal Sync Skew relative to pixel clock.
  174.  
  175. 1CEh index AFh (R/W):  ATI Register 0Fh
  176. bit  0-7  Reserved
  177.  
  178. 1CEh index B0h (R/W):  ATI Register 30 (ATI30)
  179. bit    0  Skews Display Enable by one character clock if set
  180.        1  (188xx) Enable 256 color modes
  181.           (288xx) Enable alt Video memory organization in text modes
  182.        2  (188xx) Enable 256 color modes
  183.           (28800 +) Extended Cursor Start Address. Bit 16 of the Cursor Start
  184.            Address register (3d4h index 0Eh,0Fh). Bit 17 is in 1CEh index A3
  185.            bit 3.
  186.        3  (188xx) Enable 8 CRT accesses for each CPU access
  187.      3-4  (28800-4 +) Video memory: 0=256k, 1=1M, 2=512K
  188.        4  (28800-2) Video memory: 0=256k, 1=512k
  189.        5  (28800 +) ATI-Ext 256 Color Mode Select. Enables extended 256 color
  190.             modes if set
  191.      6-7  (188xx) Display Start Address bit 16-17
  192.        6  (28800 +) Extended Display Start Address. Bit 16 of the Display
  193.            Start Address register (3d4h index 0Ch,0Dh). Bit 17 is in 1CEh
  194.            index A3h bit 4
  195.        7  (28800 +) Enable Higher bandwidth in VRAM
  196.  
  197. 1CEh index B1h (R/W):  EGA Compatibility and Double Scanning Enable
  198. bit    0  EGA I/O Address Compatibility. Forces all VGA I/O addresses to be
  199.           EGA compatible if set
  200.        1  EGA Register Compatibility. Forces all VGA registers to be EGA
  201.           compatible if set
  202.        2  General purpose read/write bit
  203.      3-5  Scan Function. Double scanning/3 of 4 scanning enable
  204.             0: Normal
  205.             1: Enable double scanning in graphics mode
  206.             2: Enable 3 of 4 scanning in graphics mode
  207.             5: Enable double scanning in text mode
  208.             6: Enable 3 of 4 scanning in text mode
  209.        6  Vertical Timings Divide by 2. If set divides the Vertical timing
  210.           parameters by 2
  211.        7  Reserved
  212.  
  213. 1CEh index B2h (R/W):  Memory Page Select
  214. bit    0  (18800) Enable interlace if set
  215.           (18800-1) reserved
  216.           (28800 +) Read bank no bit 3
  217.      1-3  (18800-1) Write/Single bank no.
  218.      1-4  (28800 +) Write/Single bank no
  219.           (18800) Bank no. in 64 chunks
  220.        5  (18800) Enable internal DIP switch settings (EGA mode)
  221.        6  (18800) External clock select. Bit 2 of the clock select. Bits 0-1
  222.             are in 3C2h/3CCh bits 2-3. Clocks in MHz:
  223.              0: 50.175, 1: 56.644, 3: 44.900, 4: 44.900, 5: 50.175, 7: 36.000
  224.        7  (18800) Reserved
  225.      5-7  (18800-1 +) Read bank no
  226.  
  227. 1CEh index B3h (R/W):  ATI Register 33 (ATI33)
  228. bit    0  EEPROM data input
  229.        1  EEPROM clock source
  230.        2  Enable EEPROM interface
  231.        3  EEPROM chip select. Enables EEPROM if set
  232.        4  (18800?)  Enable PS/2 decoding
  233.           (18800-1) Disable memory beyond 256K if set
  234.        5  (28800 +) XOR with input status bit HSYNC to select 8 or 16 bit
  235.                     video memory operation
  236.           (68800) ISA bus 8/16bit Video Memory Operation. Selects 8 or 16 bit
  237.            Video memory operation depending on whether input pin RMCE1B is
  238.            grounded through a 2K Ohm resistor.
  239.            If grounded:      1:  8bit, 1: 16bit
  240.            If NOT grounded:  0: 16bit, 1:  8bit
  241.        6  (18800) Enable 1 CRT access to 1 CPU access
  242.           (18800-1 +)  4bit PEL, 1bit/map. Enables 1024x768 16 color planar
  243.             pixel mode if set. If set 16 pixels are loaded and displayed per
  244.             character clock rather than the normal 8, also the CRTC offset
  245.             register (3d4h index 13h) is in units of 4 bytes rather than 2.
  246.        7  Double Scan Enable. Enable double scanning for 200 line modes if set
  247. Note: This register should not be modified on revision 1 chips.
  248.  
  249. 1CEh index B4h (R/W):  Emulation Control
  250. bit    0  Enable CGA emulation if set
  251.        1  Enable Hercules emulation if set
  252.        2  Write Protect CRT09[0-4,7]. If set write protects 3d4h index 9 bits
  253.            0-4 and 7
  254.        3  Write Protect Vertical Timing registers. If set write protects 3d4h
  255.           index 6, 7 bits 0-3 and 5-7, 9 bit 5, 10h, 11h bits 0-3, 12h, 15h
  256.           and 16h
  257.        4  Write Protect CRT0A-CRT0B. If set write protects the Cursor Start
  258.           and End registers (3d4h index 0Ah and 0Bh).
  259.        5  Write Protect CRT08[0-6], CRT14[0-4]. If set write protects
  260.           registers 3d4h index 8 bits 0-6 and index 14h bits 0-4
  261.        6  Write Protect CRT00-CRT07. If set write protects 3d4h index 0-7
  262.           except index 7 bit 4
  263.        7  CRT11[7] Override. If set 3d4h index 11h bit 7 is ignored and does
  264.           not lock other CRTC registers.
  265.  
  266. 1CEh index B5h (R/W):  ATI Register 35 (ATI35)
  267. bit    0  Blanking Signal Select. Select display enable as the blanking signal
  268.           if set
  269.        1  Blanking Polarity Invert. Inverts the polarity of the  blanking
  270.           signal BLANKB if set
  271.        2  Display Enable Signal Skewed. Skews the Display Enable signal by one
  272.           PEL clock period if set
  273.        3  Select Map 3 as programmable character generator
  274.           (68800) General Purpose Read/Write bit.
  275.        4  (18800-1 +) Enable 8 simultaneous fonts if set. Background is then
  276.             always 0, and bit 4-7 of the attribute selects the font.
  277.             The font location in plane 2 (sorted by attribute bit 4-7) is:
  278.               0: 0K, 1: 32K, 2: 8K, 3: 40K, 4: 16K, 5: 48K, 6: 24K, 7: 56K
  279.           (68800) Anti-alias Fonts Enable.
  280.        5  Disable Cursor Blinking if set
  281.        6  CGA Cursor Start/End Address. If set adds 5 to the cursor start and
  282.           end registers for CGA emulation.
  283.        7  Select undivided input clock as pixel clock
  284.           (68800-6) VGA Overscan Output Enable. If set generates an overscan
  285.             signal that can be used by the RAMDAC to select a color outside
  286.             the normal 256color palette (overlay registers in the RAMDAC).
  287.  
  288. 1CEh index B6h (R/W):  High Resolution Enable
  289. bit    0  (28800-4 +) CRTC Display Address Counter Enable. Set to enable
  290.             >16bit CRTC address counter. If clear the display wraps at 256K
  291.             (planar modes - 4x64K) or 512K (packed modes - 8x64K).
  292.        1  Enable 640x400 Hercules emulation if set
  293.        2  Enable linear addressing in 256color modes if set
  294.        3  Select 4 color high res modes
  295.           (68800) General Read/Write bit.
  296.        4  16 Color Enable, APA Mode. Set to enable 16 color high resolution
  297.           modes. If set the horizontal timings (3d4h index 0-5) are doubled.
  298.        5  Enable vertical interrupts if set
  299.        6  (18800 - 28800-3) Enable linear addressing
  300.           (?) Select composite sync for output
  301.           (68800) Linear Addressing, Text Mode. Enables linear addressing in
  302.             text modes if set.
  303.        7  Screen Blanking Disable. Disable blanking screen blank in CGA and
  304.           Hercules emulation if set
  305.  
  306. 1CEh index B7h (R/W):  ATI Register 37 (ATI37)
  307. bit    0  Status of ISA bus 16bit Operation Select.
  308.           16bit if set, 8bit if clear
  309.        1  (not 68800) PS/2 configuration
  310.        2  (not 68800) Video memory is DRAM if set, VRAM if clear
  311.        3  Output Data for the EEPROM input
  312.        4  Status of ROM Address Decode. Decode enabled if set
  313.        5  (not 68800) Select I/O address at 3xxh or 2xxh
  314.      6-7  Reserved
  315.  
  316. 1CEh index B8h (R/W):  Write Protect and Clock Select
  317. bit    0  Write Protect ATTR00-0F. If set write protects the Palette registers
  318.           (3C0h index 0-0Fh).
  319.        1  Write Protect ATTR11. If set write protects the Overscan register
  320.           (3C0h index 11h).
  321.        2  Write Protect VGA Registers. If set write protects all VGA registers
  322.           except the Display Start Address (3d4h index 0Ch,0Dh) and the Cursor
  323.           Start and End registers (3d4h index 0Ah and 0Bh)
  324.        3  Write Protect Register at I/O Port 3C2h if set
  325.        4  (not 68800) Lock horizontal sync polarity if set
  326.        5  (not 68800) Lock vertical sync polarity if set
  327.           (68800) 640x300 Hercules Graphics Emulation. Enabled if set
  328.      6-7  (Not 68800) Divide Video Clock by: 0: 1, 1: 2, 2: 3, 3: 4
  329.        6  (68800) Clock Divider. If set divides the input Video Clock by 2.
  330.        7  (68800) General Purpose Read/Write bit
  331.  
  332. 1CEh index B9h (R/W):  ATI Register 39 (ATI39)
  333. bit    0  (?) Clock select
  334.        1  (18800-1 +) Select input to clock chip. See index BEh bit 4
  335.           (68800) Documented as "General Purpose Read/Write bit", but is
  336.             actually a Clock Select bit as for the earlier chips!
  337.      2-3  ROM address space.
  338.             0: 32k at C000h, 1: 28k at C000h, 2,3: 24k at C000h
  339.      4-5  Wait cycles for 16 bit ROM access:
  340.             0: 8 cycles, 1: 4 cycles, 2: 2 cycles, 3: none
  341.           (68800) General Purpose Read/Write bits.
  342.        6  16bit I/O Operation. If set I/O operations are 16bits, 8bits if
  343.            clear
  344.        7  Write Protect CRT18. If set write protects the Line Compare register
  345.           (3d4h index 18h)
  346.  
  347. 1CEh index BAh (R/W):  ATI Register 3A (ATI3A)
  348. bit  0-2  (not 68800) Delay chain timing compensation for TTL monitors and
  349.             16color RGB simulation
  350.           (68800) General Purpose Read/Write bits
  351.        3  (not 68800) Disable secondary Red output (for RGB monitors)
  352.        4  (not 68800) Enable EGA color simulation for RGB monitors
  353.        5  (not 68800) Enable monochrome grey scale circuit
  354.        6  reserved
  355.        7  (not 68800) Delay chain resolution compensation
  356.  
  357. 1CEh index BBh (R/W):  Input Status Register
  358. bit  0-3  Monitor Type:
  359.             0: EGA
  360.             1: PS/2 Analog Monochrome
  361.             2: TTL Monochrome
  362.             3: PS/2 Color
  363.             4: RGB Color
  364.             5: MultiSync
  365.             7: PS/2 8514
  366.             8: Seiko 1430
  367.             9: NEC Multisync 2A
  368.             A: Crystalscan 860/Tatung 1439
  369.             B: NEC Multisync 3D
  370.             C: TVM 3M
  371.             D: NEC MultiSync XL
  372.             E: TVM 2A
  373.             F: TVM 3A
  374.        4  (188xx) General read/write bit
  375.           (28800 +) Bit 4 of the Monitor Type above
  376.        5  (188xx) Video memory is 512Kbytes if set, 256K else
  377.      6-7  Reserved
  378.      0-7  (68800) General Purpose Read/Write bits
  379. Note: this register is set by the BIOS
  380.  
  381. 1CEh index BCh (R/W):  ATI Register 3C (ATI3C)
  382. bit  0-7  reserved, must be 0
  383.  
  384. 1CEh index BDh (R/W):  EGA Switch Settings
  385. bit    0  Composite Sync Polarity Select.
  386.        2  (28800-5 +) 128K CPU Address. Enables A0000h-BFFFFh as one 128K page
  387.             if set
  388.        3  Composite Sync Select. If set selects Composite Sync output, if
  389.           clear Horizontal Sync.
  390.      4-7  EGA switch settings
  391.  
  392. 1CEh index BEh (R/W):  ATI Register E                              (not 18800)
  393. bit    0  R/W Vertical Display End Register. If set unlock Vertical Display
  394.           End register (3d4h index 12h) even in Double Scan modes.
  395.        1  Interlace Operation. Set to enable interlace.
  396.        2  Select Internal EGA DIP Switches. If set use 1CEh index BBh bits
  397.           4-7, if clear use
  398.        3  Read/Write Paging Select. Selects Read/Write bank mode if set,
  399.           single bank mode if clear
  400.        4  (18800-1 without 18810 Clock Chip (V4)) External clock select.
  401.             Bit 2 of the clock select. Bits 0-1 are in 3C2h/3CCh bits 2-3.
  402.             Clocks in MHz:
  403.              0: 50.175, 1: 56.644, 3: 44.900, 4: 44.900, 5: 50.175, 7: 36.000
  404.           (18800-1 with 18810 Clock Chip, 28800 +) Clock Select
  405.               BEh bit 4: B9h bit 1: 3C2h bit 3: 3C2h bit 2:   Frequency:
  406.                   0          0          0           0           42.954 MHz
  407.                   0          0          0           1           48.771
  408.                   0          0          1           0           Ext 0 (16.657)
  409.                   0          0          1           1           36.000
  410.                   0          1          0           0           50.350
  411.                   0          1          0           1           56.640
  412.                   0          1          1           0           Ext 1 (28.322)
  413.                   0          1          1           1           44.900
  414.                   1          0          0           0           30.240
  415.                   1          0          0           1           32.000
  416.                   1          0          1           0           37.500
  417.                   1          0          1           1           39.000
  418.                   1          1          0           0           40.000
  419.                   1          1          0           1           56.644
  420.                   1          1          1           0           75.000
  421.                   1          1          1           1           65.000
  422.           (68800) Documented as "General Purpose Read/Write bit", but is
  423.             actually a Clock Select bit as for the earlier chips!
  424.        6  (not 68800) Enable 1024x768 16 color mode
  425.        7  (not 68800) Enable 1024x768 4 color mode
  426.  
  427. 1CEh index BFh (R/W):  Miscellaneous Register                      (not 188xx)
  428. bit    0  (68800) Disable Zero Wait State in planar modes if set
  429.      1-3  (68800) Delay in number of MCLK cycles before latching first CPU
  430.             data in 16bit planar modes.
  431.        6  (288xx) ROM page address bit
  432.        7  (288xx) Alternate memory organisation for graphics enable
  433.  
  434. 23Ch (R):  Port A                                                 (18820 only)
  435. bit  0-3  The data selected by 23Eh bits 5-6.
  436.        5  Clear if the right mouse button is down.
  437.        6  Clear if the middle mouse button is down.
  438.        7  Clear if the left mouse button is down.
  439. Note: The registers 23Ch-23Fh are relocated to 238h-23Bh if the secondary
  440.       mouse port address is selected. This can be done in software or jumper.
  441.  
  442. 23Ch (R/W):  Port A                                                    (288xx)
  443. bit  0-2  Internal Register Index. Selects the register to access at 23Dh
  444.        7  Set to reset the chip, clear for normal operation.
  445. Note: The 28800 series has built in Inport Mouse support.
  446. Note: The registers 23Ch-23Fh are relocated to 238h-23Bh if the secondary
  447.       mouse port address is selected. This is done in software.
  448.  
  449. 23Ch index 0 (R/W):  Mouse State                                       (288xx)
  450. bit    0  Set if right mouse button is down
  451.        1  Set if middle mouse button is down
  452.        2  Set if left mouse button is down
  453.        3  Set if the right mouse button state has changed since Hold was set
  454.        4  Set if the middle mouse button state has changed since Hold was set
  455.        5  Set if the left mouse button state has changed since Hold was set
  456.        6  Set if the mouse has moved
  457.        7  Set if packet complete
  458. Note: this register is valid when 23Ch index 7 bit 5 is set
  459.  
  460. 23Ch index 1 (R/W):  X Movement Count                                  (288xx)
  461. bit  0-7  X-Count. Two's complement movement X count
  462. Note: this register is valid when 23Ch index 7 bit 5 is set
  463.  
  464. 23Ch index 2 (R/W):  Y Movement Count                                  (288xx)
  465. bit  0-7  Y-Count. Two's complement movement Y count
  466. Note: this register is valid when 23Ch index 7 bit 5 is set
  467.  
  468. 23Ch index 7 (R/W):  Mode                                              (288xx)
  469. bit  0-2  Timer Select. Sets the maximum interrupt rate. Interrupts only occur
  470.           if the button state has changed or the mouse has moved.
  471.            0: 0Hz (Never), 1: 30Hz, 2: 50Hz, 3: 100Hz, 4: 200Hz, 6: Always
  472.        3  Data Interrupt Enable. If set an interrupt will be generated when
  473.           the button state has changed or the mouse has moved.
  474.        4  Timer Interrupt Enable. If set interrupts will be generated at the
  475.           frequency specified in bits 0-2.
  476.        5  Hold. Should be set before reading index 0-2 and reset after.
  477.      6-7  Mode. 0: Quadrature Mouse.
  478.  
  479.  
  480. 23Dh (R/W):  Port B                                               (18820 only)
  481. Note: only used to detect I/O address
  482.  
  483. 23Eh (R/W):  Port C                                               (18820 only)
  484. bit    0  (R) Set if IRQ5 selected
  485.        1  (R) Set if IRQ4 selected
  486.        2  (R) Set if IRQ3 selected
  487.        3  (R) Set if IRQ2 selected
  488.        4  Interrupts disabled if set, enabled if clear
  489.      5-6  Counter Read Select. Selects the data to return in 23Ch bits 0-3
  490.            0: Low nibble of X Counter
  491.            1: High nibble of X Counter
  492.            2: Low nibble of Y Counter
  493.            3: High nibble of Y Counter
  494.        7  Hold. Set this bit at the beginning of the Interrupt Service Rutine,
  495.           clear after reading counter.
  496.  
  497. 23Eh (R):  Port C                                                      (288xx)
  498. Bit  0-7  Alternates between DEh and 11h on each read.
  499.  
  500. 23Fh (R/W):  Port D                                               (18820 only)
  501. bit  0-7  Used to control timer, must be 91h
  502.  
  503. 2EEh (W):  Overscan Color Register                                    (Mach32)
  504. bit  0-7  OVERSCAN_COLOR_8. Overscan color for 4 and 8bit modes
  505.  
  506. 2EFh (W):  24Bit Blue Overscan Component                              (Mach32)
  507. bit  0-7  OVERSCAN_BLUE_24. Blue Overscan color for 16 and 24bit modes
  508.  
  509. 3C0h index 00h-0Fh (R/W):  Palette index register
  510. bit 4-5  Mode 67h Palette set selection. These bits should be the same in all
  511.          16 attribute registers.
  512.          Value   Pixel=0    1      2         3
  513.           0       Black  White  Grey      Bright White
  514.           1       Black  Green  Red       Yellow
  515.           2       Black  Cyan   Red       White
  516.           3       Black  Cyan   Magenta   White
  517. Note: this is special to mode 67h only!!
  518.  
  519. 3CEh index 50h (R/W):                                        (Mach32/64 only?)
  520. bit  0-7  Lower 8 bits of the ATI extended register base I/O address
  521.  
  522. 3CEh index 51h (R/W):                                        (Mach32/64 only?)
  523. bit  0-3  Bits 8-11 of the ATI extended register base I/O address. Bits 0-7
  524.           are in 3CEh index 50h.
  525.      6-7  Selects the index range for the extended registers within the ATI
  526.           extended registers. 0: 00h-3Fh, 1: 40h-7Fh, 2: 80h-BFh, 3: C0h-FFh
  527. Note: Usually these registers are programmed to place the extended registers
  528.       at 1CEh with index 80h-BFh. (50h = CEh and 51h = 81h).
  529.  
  530. 6EEh (W):  24Bit Green Overscan Component                             (Mach32)
  531. bit  0-7  OVERSCAN_GREEN_24. Green Overscan color for 16 and 24bit modes
  532.  
  533. 6EFh (W):  24Bit Red Overscan Component                               (Mach32)
  534. bit  0-7  OVERSCAN_RED_24. Red Overscan color for 16 and 24bit modes
  535.  
  536. 0AEEh W(W):  Cursor Offset Low                                        (Mach32)
  537. bit 0-15  CURSOR_OFFSET_LO. Lower bits of the address (in DWORDs) of the
  538.           cursor map in video memory. The upper bits are in 0EEEh. The cursor
  539.           map is a 64x64 pixel map with two bits per pixel.
  540.           Pixel:    Pixel Color:
  541.             0       Cursor Color 0
  542.             1       Cursor Color 1
  543.             2       Transparent (Screen data)
  544.             3       Complement (XOR cursor)
  545.  
  546. 0EEEh W(W):  Cursor Offset High                                       (Mach32)
  547. bit  0-3  CURSOR_OFFSET_HI. Upper bits of the address of the cursor map. Low
  548.           bits are in 0AEEh.
  549.       15  CURSOR_ENA. Set to enable the Hardware Cursor
  550.  
  551. 12EEh W(R):  Configuration Status 1 Register                           (Mach8)
  552. bit    0  CLK_MODE. Set to use clock chip, clear to use crystals.
  553.        1  BUS_16. Set for 16bit bus, clear for 8bit bus
  554.        2  MC_BUS. Set for MicroChannel bus, clear for ISA/EISA bus
  555.        3  EEPROM_ENA. EEPROM enabled if set
  556.        4  DRAM_ENA. Set for DRAM, clear for VRAM.
  557.      5-6  MEM_INSTALLED. Video memory. 0: 512K, 1: 1024K
  558.        7  ROM_ENA. Set is ROM is enabled
  559.        8  ROM_PAGE_ENA. Set if ROM paging enabled
  560.     9-15  ROM_LOCATION. If bit 2 and 3 are 0 the ROM will be at this location:
  561.            0: C000h, 1: C080h, 2: C100h, .. 127: FF80h (unlikely)
  562.  
  563. 12EEh W(R):  Configuration Status 1 Register                          (Mach32)
  564. bit    0  8514_ONLY. If set the VGA is disabled, if clear VGA and 8514 enabled
  565.      1-3  BUS_TYPE. 0: ISA, 1:EISA, 2:16bit MCA, 3: 32bit MCA, 4: Local Bus
  566.            (386SX), 5: Local Bus (386DX), 6: Local Bus (486), 7: PCI
  567.      4-6  MEM_TYPE. Memory type:
  568.             0: 256Kx4 DRAM
  569.             1: 256Kx4 VRAM with 512bit serial transfer
  570.             2: (68800-3) 256Kx4 VRAM with 256bit serial transfer
  571.                (68800-6 +) 256Kx16 VRAM with 256bit serial transfer
  572.             3: 256Kx16 DRAM
  573.           Remaining only for 68800-6 and up:
  574.             4: 256Kx4 Graphics DRAM
  575.             5: 256Kx4 VRAM with 512bit split transfer
  576.             6: 256Kx16 VRAM with 256bit spilt transfer
  577.        7  CHIP_DIS. Chip disabled if set
  578.        8  TST_VCTR_ENA. If set delay memory write data by 0.5 MCLK for test
  579.           vector generation.
  580.     9-11  DACTYPE: Indicates the type of RAMDAC installed:
  581.             0: ATI 68830 (8bit i/f, 8 and 15/16bit modes)
  582.             1: SC1148x, IMS-G173,MU9c4870 (8bit i/f, 8 and 15/16bit modes)
  583.             2: ATI68875, Bt885, TLC34075 (24/32bit i/f, 8,15/16 and 24bit
  584.                 modes)
  585.             3: Bt47x, INMOS17x (8bit i/f, 8bit modes - standard DAC)
  586.             4: AT&T20c49x, Bt48x, IMS-G174, MU9c1880, MU9c4910, SC1502x
  587.                  (8bit i/f, 8,15/16 and 24bit modes)
  588.             5: ATI68860 (24/32/64bit i/f, 8,15/16 and 24bit modes)
  589.                Only for 68800-AX
  590.       12  MC_ADR_DECODE. Enable internal microchannel address decode if set,
  591.           external if clear
  592.    13-15  CARD_ID. Used for multiple controllers
  593.  
  594. 12EE W(W):  Horizontal Cursor Position Register                       (Mach32)
  595. bit 0-10  H_CUR_POSN. Cursor X-position in units of 8 pixels relative to the
  596.           address in 2AEEh & 2EEEh
  597.  
  598. 16EEh (R):  Configuration Status 2 Register                            (Mach8)
  599. bit    0  SHARE_CLOCK. If set the Mach8 shares clock with the VGA
  600.        1  HIRES_BOOT. Boot in hi-res mode if set
  601.        2  EPROM_16_ENA. Adapter configured for 16bit ROM if set
  602.        3  WRITE_PER_BIT. Write masked VRAM operations supported if set
  603.        4  FLASH_ENA. Flash page writes supported if set
  604.  
  605. 16EEh W(R):  Configuration Status 2 Register                          (Mach32)
  606. bit    0  (68800-3 only) SLOW_SEQ_EN. Use 2 clock sequencer timing if set,
  607.             1 clock sequencer timing if clear
  608.        1  MEM_ADDR_DIS. Disable FE0000h-FFFFFFh if set
  609.        2  ISA_16_ENA. (ISA bus only) 16bit ISA bus if set, 8bit if clear
  610.        3  KOR_TXT_MODE_ENA. Korean character font support enabled if set
  611.      4-5  LOCAL_BUS_SUPPORT.
  612.             1: LOCAL2# local bus signal selected
  613.             2: LOCAL3# local bus signal selected
  614.             3: LOCAL1# local bus signal selected
  615.        6  LOCAL_BUS_CONFIG_2. LBus_2 configuration (non-multiplexed) if set,
  616.           LBus_1 configuration (multiplexed) if clear
  617.        7  LOCAL_BUS_RD_DLY_ENA. If set read data is held for 1 bus clock after
  618.           RDY
  619.        8  LOCAL_DAC_EN. Disable local decode of RAMDAC write in local bus
  620.           systems if set
  621.        9  LOCAL_RDY_EN. Enable 1 bus clock RDY delay for write if clear
  622.       10  EEPROM_ADR_SEL. Decode BIOS EEPROM at C0000h-C7FFFh if set, at
  623.           E0000h-E7FFFh if clear
  624.       11  GE_STRAP_SEL. (EISA bus) Enable POS register function if set, always
  625.           enable chip if clear. (Local Bus) Enable local decode of 102h
  626.           register if clear
  627.       12  VESA_RDY. Enable VESA compliant RDY format if clear
  628.       13  (68800-6 +) Z4GBYTE. Enable 4GN memory aperture if set, 128MB if
  629.             clear
  630.       14  (68800-6 +) LOC2_MDRAM. Supports 2MB DRAM in LBus_2 configuration if
  631.             set, 1MB if clear
  632.  
  633. 16EE W(W):  Vertical Cursor Position Register                         (Mach32)
  634. bit 0-11  V_CUR_POSN. Cursor Y-position relative to the address in 2AEEh &
  635.           2EEEh
  636.  
  637. 1AEEh W(R):  FIFO Test Data Register                                  (Mach32)
  638. bit 0-15  FIFO test data
  639.  
  640. 1AEEh (W):  Cursor Color 0 Register                                   (Mach32)
  641. bit  0-7  CUR_COLOR_0. Cursor Color 0. In 16 and 24 bit modes this is the Blue
  642.           component of Cursor Color 0
  643.  
  644. 1AEFh (W):  Cursor Color 1 Register                                   (Mach32)
  645. bit  0-7  CUR_COLOR_1. Cursor Color 1. In 16 and 24 bit modes this is the Blue
  646.           component of Cursor Color 1
  647.  
  648. 1EEEh (W):  Horizontal Cursor Offset Register                         (Mach32)
  649. bit  0-5  CUR_H_OFFSET. First horizontal pixel actually used within the 64x64
  650.           cursor map.
  651.  
  652. 1EEFh (W):  Vertical Cursor Offset Register                           (Mach32)
  653. bit  0-5  CUR_V_OFFSET. Number of lines shown in the cursor
  654.  
  655. 22EEh (R/W):  PCI Control Register                                  (68800-AX)
  656. bit  0-2  DAC_RW_WS. RAMDAC read/write wait states
  657.        3  TARGET_ABORT_EN. Enable Target Abort Cycle if set
  658.        4  PCI_DAC_DLY. If set increases the hold time of the register select
  659.           signals relative to the falling edge of the DAC write signal
  660.        5  DAC_SNOOP_EN. Enables snooping on DAC read if set
  661.        6  FAST_BURST. Enables 0 wait states on aperture Burst Write if set
  662.        7  FAST_MEM_IO. Fast memory mapped I/O read/write enabled if set
  663.  
  664. 26EEh (W):  CRT Pitch Register                                      (Mach8/32)
  665. bit  0-7  Width of logical scanlines in units of 8 pixels.
  666.           (Mach8) When 4AE8h or BEE8h index 5 is written this register is
  667.             reset to 128 (=1024 pixels)
  668.  
  669. 2AEEh W(W):  CRT Offset Low Register                                (Mach8/32)
  670. bit 0-15  Lower 16 bits of the CRT Offset. The upper bits are in 2EEEh.
  671.           The start of the displayed image in units of 4 bytes.
  672.  
  673. 2EEEh W(W):  CRT Offset High Register                               (Mach8/32)
  674. bit  0-3  Upper bits of the CRT Offset. Lower bits are in 2AEEh.
  675.  
  676. 32EEh W(R/W):  Local Control Register                                 (Mach32)
  677. bit    0  MED_NON-PAGE-CYC. Enables 6 clock non-page cycle
  678.        1  LONG_NON-PAGE-CYC. Enables 7 clock non-page cycle
  679.        2  SHORT_CAS_PULSE_EN. Enables 1/2 memory clock CAS precharge time
  680.        3  DAC_BLANK_ADJ. Enables DAC to be clocked on positive clock edge
  681.        4  FIFO_TEST. Enables testing of FIFO
  682.      5-6  (68800-3) FIFO_TIMING_ADJ. Enables filtering of 1 clock IOW low or
  683.             high pulse
  684.        5  (68800-6 +) MEM_MAP_ENA. Enables Memory Mapped registers
  685.              The memory mapped registers are located in the last 512 bytes of
  686.              the aperture (1MB or 4MB). 4 bytes are allocated to each register
  687.              Memory Address:  I/O register:
  688.                  xFFE00         02E8h
  689.                  xFFE04         06E8h
  690.                    <Other xxE8h registers>
  691.                  xFFEFC         FEE8h
  692.                  xFFF00         02EEh
  693.                  xFFF04         06EEh
  694.                    <Other xxEEh registers>
  695.                  xFFFFC         FEEEh
  696.        6  (68800-6 +) LOC_BIOS_ENA. Enables Local Bus BIOS ROM Decode
  697.      7-9  ROM_WAIT. Number of ROM wait states. Default is 7.
  698.    10-11  MEM_R_DELAY. Additional wait states for memory reads. Default is 3
  699.    12-15  (not 68800-AX on PCI bus) LOCAL_BUS_WAIT. Minimum wait states for
  700.             local bus. Default is 15
  701.           (68800-AX on PCI bus) 8514IO_WAIT. Number of wait states for I/O
  702.             read/write operations.
  703.  
  704. 36EEh (W):  FIFO Options Register                                      (Mach8)
  705. bit    0  W_STATE_ENA. If clear wait states disabled unless FIFO is full, if
  706.           set wait states are generated if the FIFO is at least half full.
  707.           This bit does not affect wait states for 8514/A compatible registers
  708.        1  HOST_8_ENA. Clear for 16bit I/O operations, set for 8bit I/O
  709.  
  710. 36EEh W(R/W):  Miscellaneous Register                                 (Mach32)
  711. bit    0  W_STATE_ENA. If clear wait states disabled unless FIFO is full, if
  712.           set wait states are generated if the FIFO is at least half full.
  713.           This bit does not affect wait states for 8514/A compatible registers
  714.        1  HOST_8_ENA. Clear for 16bit I/O operations, set for 8bit I/O
  715.      2-3  MEM_SIZE_ALIAS. Video Memory: 0: 512K, 1: 1MB, 2: 2MB, 3: 4MB
  716.        4  DISABLE_VGA. VGA controller enabled if clear.
  717.        5  16_BIT_IO. 16bit 8514 I/O enabled if set.
  718.        6  DISABLE_DAC. Disables local DAC if set
  719.        7  DLY_LATCH_ENA. For VRAM this is the serial data delay latch enable,
  720.           for DRAM the memory data delay latch enable for bits 0-63.
  721.        8  TEST_MODE. Extends draw engine page write cycle to 3 clocks for test
  722.           purposes.
  723.       10  (68800-6 +) BLK_WR_ENA. Block Write Enabled if set. Utilises the
  724.             block write mode of most VRAMs which expands all '1' data bits to
  725.             a specified color in the corresponding nibbles. '0 bits are no-ops
  726.             Only supported if the memory type is 5 or 6.
  727.       11  (68800-6 +) 64_DRAW_ENA. 64bit Draw Enable if set.
  728.       12  MEM_DATA_SEL. If set video memory read data is latched on the rising
  729.           edge of CASB, if clear it flows through.
  730.       13  DLY_LATCH_ENA. Memory data delay latch enable for data bits 0-63
  731.       14  LATCH_FULL_ENA. Memory Data Latch full clock pulse enable
  732.  
  733. 3AEEh (R):  FIFO Test Tag Register                                    (Mach32)
  734. bit  0-4  FIFO test data
  735.  
  736. 3AEEh W(W):  Extended Cursor Color 0 Register                         (Mach32)
  737. bit  0-7  EXT_CUR_COL_0_G. Green component of the Cursor Color 0 in 16 and
  738.           24bit modes
  739.     8-15  EXT_CUR_COL_0_R. Red component of the Cursor Color 0 in 16 and
  740.           24bit modes
  741.  
  742. 3EEEh W(W):  Extended Cursor Color 1 Register                         (Mach32)
  743. bit  0-7  EXT_CUR_COL_1_G. Green component of the Cursor Color 1 in 16 and
  744.           24bit modes
  745.     8-15  EXT_CUR_COL_1_R. Red component of the Cursor Color 1 in 16 and
  746.           24bit modes
  747.  
  748. 42EEh (R/W):  Memory Boundary Register                                (Mach32)
  749. bit  0-3  MEM_PAGE_BNDRY. Division between VGA and 8514 memory in 256K units.
  750.            1: VGA can write in the first 256K, 8514 in all but the first 256K
  751.            2: VGA can write in the first 512K, 8514 in all but the first 512K
  752.            etc.
  753.        4  MEM_BNDRY_ENA. If set the VGA and 8514 can only write in each their
  754.           own memory area, if clear each can write in all of memory.
  755.  
  756. 46EEh W(W):  Shadow Set Control Register                            (Mach8/32)
  757. bit    0  LOCK_CRT_PARAMS. Locks the display mode CRT parameters - Double Scan
  758.           and Interlace.
  759.        1  LOCK_Y_CONTROL. Locks 22E8h bits 1-2
  760.        2  LOCK_H_PARAMS. Locks the Horizontal Sync parameters: Position, Width
  761.           and Total.
  762.        3  LOCK_H_DISP. Locks Horizontal Displayed
  763.        4  LOCK_V_PARAMS. Locks Vertical Sync parameters: Width, Start and
  764.           Total.
  765.        5  LOCK_V_DISP. Locks Vertical Displayed
  766.        6  (Mach32) LOCK_OVERSCAN. Locks the selection of shadow overscan
  767.             register set in 1024x768 resolution.
  768.  
  769. 4AEEh W(R/W):  Clock Select Register                                (Mach8/32)
  770. bit    0  PASS_THROUGH. If set video output id's from the 8514, if clear from
  771.           either the internal VGA or from the Feature Connector.
  772.      2-5  CLK_SEL. Clock Select lines to the 1881x clock chip.
  773.        6  CLK_DIV. If set divide clock by 2.
  774.        7  Refresh. Enables video memory refresh counter if clear.
  775.     8-11  VFIFO_DEPTH. When the Video FIFO has less than this number of
  776.           entries refill will start. Only used for DRAM systems, however
  777.           performance at high resolutions can be optimized regardlessly.
  778.       12  COMPOSITE_SYNC.
  779.           (Mach8) If set Composite Sync used with the primary CRT register
  780.             set, if clear Composite Sync used when programming CRT Shadow Set
  781.             1 or 2.
  782.           (Mach32) Set for Composite Sync, clear for separate Sync.
  783. Note: in Mach8 mode this register is Read Only.
  784.       Writing to this register switches the CRT controller to ATI mode,
  785.       writing to 4AE8h switches to 8514 mode.
  786.  
  787. 52EEh W(R/W):  Scratch Pad 0 Register                                 (Mach32)
  788. bit  0-6  ROM address: 0: C000h, 1: C080h, 2: C100h ...
  789.     8-15  Scratch Pad
  790.  
  791. 56EEh W(R/W):  Scratch Pad 1 Register                                 (Mach32)
  792. bit 0-15  Scratch Pad
  793.  
  794. 5AEEh W(W):  Shadow Set Register                                    (Mach8/32)
  795. bit  0-1  SHADOW_SET. Selects the current CRT register set:
  796.             0: Primary CRT register set
  797.             1: Shadow set 1 (usually 640x480)
  798.             2: Shadow set 2 (usually 1024x768)
  799.      8-9  (68800-6 +) LOAD_SRC/DST. Determines whether the source and
  800.             destination offset/pitch registers are loaded together:
  801.              0: Load Destination and Source Offset/Pitch registers together
  802.              1: Load Destination Offset/Pitch register only
  803.              2: Load Source Offset/Pitch register only
  804.  
  805. 5EEEh W(R/W):  Memory Aperture Configuration Register                 (Mach32)
  806. bit  0-1  MEM_APERT_SEL. Aperture: 0: Disabled, 1: 1MB, 2: 4MB
  807.           PCI configuration does not support 1MB aperture
  808.      2-3  MEM_APERT_PAGE. Memory aperture page selection in 1MB aperture mode.
  809.     4-15  MEM_APERT_LOC. Address of aperture in 1MB steps between 0 and 4GB
  810.     8-15  MEM_APERT_LOC. Address of aperture in 1MB steps between 0 and 128MB
  811. Note: bit 8-15 is used as the Aperture Address except for PCI systems and
  812.       multiplexed local bus systems (16EEh bit 13 set) where bit 4-15 are used
  813.  
  814. 62EEh W(R):  Extended Graphics Engine Status Register                 (Mach32)
  815. bit  0-3  CLIP_OVERRUN. Clip Overrun
  816.        8  CLIP_INSIDE. Clip Inside
  817.     9-12  CLIP_FLAGS. For each bit: 0: outside scissor, 1: inside ?
  818.       13  GE_ACTIVE. The Graphics Engine is busy if set.
  819.       14  EE_DATA_IN. EEProm data in
  820.       15  POINTS_OUTSIDE. Points Outside.
  821.  
  822. 62EEh W(W):  Horizontal Overscan Register                             (Mach32)
  823. bit  0-3  Overscan Width - left side in character units
  824.      4-7  Overscan Width - right side in character units
  825.     8-10  (68800-6 +) H_SYNC_DELAY. Horizontal Sync Delay in pixels (for
  826.             1280x1024 multiplexed pixel modes in units of 2 pixels)
  827.       12  (68800-6 +) OSCAN_INV. Inverts Overscan Polarity if set
  828.       13  (68800-6 +) SYN_CONT_SEL. If set bits 14-15 controls HSYNC and VSYNC
  829.       14  (68800-6 +) HSYN_CONT. If bit 13 is set this bit controls the HSYNC
  830.             signal
  831.       15  (68800-6 +) VSYN_CONT. If bit 13 is set this bit controls the VSYNC
  832.             signal
  833.  
  834. 66EEh W(W):  Vertical Overscan Register                               (Mach32)
  835. bit  0-7  Overscan height - top in lines
  836.     8-15  Overscan height - bottom in lines
  837.  
  838. 6AEEh W(R/W):  Maximum Wait-States Register              (Mach8, 68800-3/6/LX)
  839. bit  0-3  Q_WSTATES. Max number of wait-states (in units of 0.25 clocks) that
  840.           the engine can generate during I/O writes. 0 = No Wait states
  841.           Set to 0Ch on hardware reset
  842.      4-7  ROM_SPEED. Number of wait states inserted by the engine when the ROM
  843.           BIOS is read. Set to 0Fh on hardware reset. 0 = No Wait states.
  844.        8  LINE_OPT_ENA. Horizontal Line draw optimisations enabled if clear.
  845.           Must be disabled during degree-mode linedraws to keep the ERR_TERM
  846.           register 8514 compatible.
  847.        9  (Mach8) IOR16_ENA. 16bit I/O reads enabled if clear.
  848.       10  (Mach8) PASSTHROUGH_OVERRIDE. Clear if passthrough connection made,
  849.             set if not (no VGA sync detected). Must be set correctly for the
  850.             DAC to function.
  851.  
  852. 6AEEh W(R/W):  Memory Aperture Configuration Register               (68800-AX)
  853. bit   10  F_APERT_ENA. Enables zero waitstate aperture write if set
  854.       11  FIFO_RD_AHEAD. Enables Read Ahead for aperture read operation if set
  855.           Speeds up sequential reads
  856.       12  SCLK_DLY. Pixel Stream 1 SCLK Delay if set
  857.       13  DEC_BURST_ENA. Enables Decrement Burst if set
  858.       14  INC_BURST. Increments Burst if set, decrements if clear
  859.       15  PCI_TIMEOUT_DIS. Enables bus timeout on burst read/writes if clear
  860. Note: This register available in PCI configurations only
  861.  
  862. 6EEEh W(W):  Graphics Engine Offset Low Register                    (Mach8/32)
  863. bit 0-15  Lower bits of the Graphics Engine Offset. Upper bits are in 72EEh.
  864.           Video buffer address in units of 4 bytes
  865.  
  866. 72EEh W(R):  Bounds Accumulator Left Register                       (Mach8/32)
  867. bit 0-15  BOUNDS_LEFT. The lowest X coordinate written through the linedraw
  868.           register. Reset to 2047 when A2EEh bit 8 is set
  869.  
  870. 72EEh (W):  Graphics Engine Offset High Register                    (Mach8/32)
  871. bit  0-3  Upper 4 bits of the Graphics Engine Offset. Lower bits are in 6EEEh
  872.  
  873. 76EEh W(R):  Bounds Accumulator Top Register                        (Mach8/32)
  874. bit 0-15  BOUNDS_TOP. The lowest X coordinate written through the linedraw
  875.           register. Reset to 2047 when A2EEh bit 8 is set
  876.  
  877. 76EEh (W):  Graphics Engine Pitch Register                          (Mach8/32)
  878. bit  0-7  GE_PITCH. Width of the display buffer in units of 8 pixels.
  879.  
  880. 7AEEh (W):  Extended Graphics Engine Configuration Register            (Mach8)
  881. bit    0  EE_DATA_OUT
  882.        1  EE_CLK
  883.        2  EE_CS
  884.        3  ALIAS_ENA
  885.        4  Z1280
  886.        7  EE_SELECT
  887. Note: This register is used in 8bit mode (card in an 8bit slot or the 8/16bit
  888.       jumper set for 8bit)
  889.  
  890. 7AEEh W(R):  Bounds Accumulator Right Register                      (Mach8/32)
  891. bit 0-15  BOUNDS_RIGHT. The highest X coordinate written through the linedraw
  892.           register. Reset to -2048 when A2EEh bit 8 is set
  893.  
  894. 7AEEh W(W):  Extended Graphics Engine Configuration Register        (Mach8/32)
  895. bit  0-2  MONITOR_ALIAS. Alternate monitor ID for 8514/A application use
  896.        3  ALIAS_ENA. If set read of the Subsystem Status register (42E8h)
  897.           returns the monitor ID in bit 0-2 rather than the actual ID.
  898.      4-5  (Mach32) PIXEL_WIDTH. Number of bits per pixel
  899.               0: 4bits/pixel(bpp), 1: 8bpp, 2: 16bpp, 3: 24bpp
  900.             16 and 24 bits per pixel only supported if we have at least 1MB
  901.             and the DAC can handle it.
  902.      6-7  (Mach32) 16_BIT_COLOR_MODE. 16bit pixel format:
  903.             0: (5,5,5) Red = bit 10-14, Green = bit  5-9, Blue = bit 0-4
  904.             0: (5,6,5) Red = bit 11-15, Green = bit 5-10, Blue = bit 0-4
  905.             0: (6,5,5) Red = bit 10-15, Green = bit  5-9, Blue = bit 0-4
  906.             0: (6,6,4) Red = bit 10-15, Green = bit  4-9, Blue = bit 0-3
  907.        8  (Mach32) MULTIPLEX_PIXELS. If set 4 pixels are sent to the DAC in
  908.             parallel
  909.        9  (Mach32) 24_BIT_COLOR_CONFIG. If set 24bit pixel occupy 4 bytes and
  910.             bit 10 selects the unused byte within the pixel, if clear 24bit
  911.             pixel occupy 3 bytes.
  912.       10  (Mach32) 24_BIT_COLOR_ORDER. Selects the order the colors are stored
  913.             in 24bit pixels. If set Red is stored first, if clear blue first.
  914.              Bit10  Bit9    Red     Green    Blue
  915.                0      0   Byte 2   Byte 1   Byte 0
  916.                0      1   Byte 3   Byte 2   Byte 1
  917.                1      0   Byte 0   Byte 1   Byte 2
  918.                1      1   Byte 0   Byte 1   Byte 2
  919.       11  (68800-6 +) DISPLAY_PIXEL_SIZE. Set to load display pixel size.
  920.             If both bit 11 and 15 are 0 both pixel sizes are loaded
  921.    12-13  (Mach32) DAC_EXT_ADDR. Connected to RS2 and RS3 on the DAC.
  922.       12  (Mach8) EE_DATA_OUT. Data output for the EEPROM
  923.       13  (Mach8) EE_CLK. Clock signal for the EEPROM
  924.       14  (Mach32) DAC_8_BIT_EN. Set for 8bit DAC operation, clear for 6bit
  925.           (Mach8) EE_CS. Chip select line for the EEPROM
  926.       15  (68800-6 +) DRAW_PIXEL_SIZE. Set to load drawing pixel size.
  927.             If both bit 11 and 15 are 0 both pixel sizes are loaded
  928.           (Mach8) EE_SELECT. Must be set to enable read/writing the EEPROM
  929. Note: On the Mach32 this register can be read at 8EEEh
  930.  
  931. 7EEEh W(R):  Bounds Accumulator Bottom Register                     (Mach8/32)
  932. bit 0-15  BOUNDS_BOTTOM. The highest Y coordinate written through the linedraw
  933.           register. Reset to -2048 when A2EEh bit 8 is set
  934.  
  935. 7EEEh W(W):  ROM/EEPROM/DAC Control Register                          (Mach32)
  936. bit    0  EE_DATA_OUT. Data output to the EEPROM
  937.        1  EE_CLK. Clock signal for the EEPROM
  938.        2  EE_CS. Chip select for EEPROM
  939.        3  EE_SELECT. Enables the external EEPROM for reading and writing if
  940.           set
  941.      4-7  ROM_PAGE_SEL. Selects a 2K page within the 32K ROM
  942.      8-9  BLANK_ADJUST. For type 2 DACs (ATI68875) only. Delays BLANK by 1 or
  943.            2 PCLKs
  944.    10-11  PIXEL_DELAY. Adjusts pixel data skew from PCLK
  945.       12  PASSTHRU_OVERIDE. Allows the pixel clock to remain active even when
  946.           PASSTHROUGH is 0
  947.    13-15  CARD_SELECT. Allows selection of cards in multicard systems. The
  948.           card is active if the card is strapped to this value or zero.
  949.  
  950. 82EEh (R/W):  Pattern Data Index Register                           (Mach8/32)
  951. bit  0-7  (68800-3) Selects 1 of 18 pattern data registers
  952.      0-4  (68800-6 +) Selects one of 24 pattern data registers
  953. Note: the data is written to 8EEEh. Each write increments this index
  954.       Index 0-0Fh are the color pattern data registers, 10h-11h (10h-17h for
  955.       the 68800-6 and later) are the mono pattern data registers.
  956.  
  957. 8EEEh W(R):  Read Extended Graphics Engine Configuration Register     (Mach32)
  958. bit  0-2  MONITOR_ALIAS. Alternate monitor ID for 8514/A application use
  959.        3  ALIAS_ENA. If set read of the Subsystem Status register (42E8h)
  960.           returns the monitor ID in bit 0-2 rather than the actual ID.
  961.      4-5  PIXEL_WIDTH. Number of bits per pixel
  962.               0: 4bits/pixel(bpp), 1: 8bpp, 2: 16bpp, 3: 24bpp
  963.             16 and 24 bits per pixel only supported if we have at least 1MB
  964.             and the DAC can handle it.
  965.      6-7  16_BIT_COLOR_MODE. 16bit pixel format:
  966.             0: (5,5,5) Red = bit 10-14, Green = bit  5-9, Blue = bit 0-4
  967.             0: (5,6,5) Red = bit 11-15, Green = bit 5-10, Blue = bit 0-4
  968.             0: (6,5,5) Red = bit 10-15, Green = bit  5-9, Blue = bit 0-4
  969.             0: (6,6,4) Red = bit 10-15, Green = bit  4-9, Blue = bit 0-3
  970.        8  MULTIPLEX_PIXELS. If set 4 pixels are sent to the DAC in parallel
  971.        9  24_BIT_COLOR_CONFIG. If set 24bit pixel occupy 4 bytes and bit 10
  972.           selects the unused byte within the pixel, if clear 24bit pixel occupy
  973.            3 bytes.
  974.       10  24_BIT_COLOR_ORDER. Selects the order the colors are stored in 24bit
  975.           pixels. If set Red is stored first, if clear blue first.
  976.              Bit10  Bit9    Red     Green    Blue
  977.                0      0   Byte 2   Byte 1   Byte 0
  978.                0      1   Byte 3   Byte 2   Byte 1
  979.                1      0   Byte 0   Byte 1   Byte 2
  980.                1      1   Byte 0   Byte 1   Byte 2
  981.       11  (68800-6 +) DISPLAY_PIXEL_SIZE. Set to load display pixel size.
  982.             If both bit 11 and 15 are 0 both pixel sizes are loaded
  983.    12-13  DAC_EXT_ADDR. Connected to RS2 and RS3 on the DAC.
  984.       14  DAC_8_BIT_EN. Set for 8bit DAC operation, clear for 6bit
  985.       15  (68800-6 +) DRAW_PIXEL_SIZE. Set to load drawing pixel size.
  986.             If both bit 11 and 15 are 0 both pixel sizes are loaded
  987. Note: This register is written at 7AEEh
  988.  
  989. 8EEEh W(W):  Color/Monochrome Pattern Data Registers                (Mach8/32)
  990. bit 0-15  Pattern data. 82EEh selects the pattern data registers to write to.
  991.  
  992. 92EEh W(R):  ROM Page Select & EEPROM Control Register                (Mach32)
  993. bit  4-7  ROM_PAGE_SEL. Selects a 2K page within the 32K ROM
  994.      8-9  BLANK_ADJUST. For type 2 DACs (ATI68875) only. Delays BLANK by 1 or
  995.            2 PCLKs
  996.    10-11  PIXEL_DELAY. Adjusts pixel data skew from PCLK
  997.  
  998. 96EEh W(R/W):  Bresenham Count Register                             (Mach8/32)
  999. bit 0-10  COUNT. The largest of the absolute values of delta X and delta Y
  1000.  
  1001. 9AEEh W(R):  Extended FIFO Status Register                          (Mach8/32)
  1002. bit 0-15  Each bit is set if the corresponding FIFO location is occupied and
  1003.           clear if it is free. Bit 15 will clear first.
  1004.  
  1005. 9AEEh (W):  Linedraw Index Register                                 (Mach8/32)
  1006. bit  0-2  Determines the type of line data written to FEEEh.
  1007.             0: Set current X, 1: Set current Y, 2: Line end X, 3: Line end Y,
  1008.             4: set current X, 5: Set current Y.
  1009.           Writing to FEEEh increments this index, except that 3 wraps to 2 and
  1010.           5 to 4 so that a polyline can be output by setting this index to 0
  1011.           and then writing the coordinates to FEEEh.
  1012.  
  1013. A2EEh W(R/W):  Linedraw Options Register                            (Mach8/32)
  1014. bit    1  POLY_MODE. Clear for normal linedraw, set for polygon linedraw mode.
  1015.        2  LAST_PEL_OFF. Set if the last pixel of a line should not be drawn.
  1016.        3  DIR_TYPE. If set lines are drawn in the direction set by bits 5-7
  1017.           and of the length in the Bresenham Count Register (96EEh), if clear
  1018.           according to the Bresenham parameters
  1019.      5-7  (bit 3=1) DEGREE. Direction of the line in degrees
  1020.             0: 0, 1: 45, 2: 90, 3: 135, 4: 180, 5: 225, 6: 270, 7: 315
  1021.        5  (bit 3=0) XDIR.  Set to draw to the right (increase X)
  1022.        6  (bit 3=0) YMAJOR. Set if delta Y > delta X (numerically)
  1023.        7  (bit 3=0) YDIR. Set to draw downwards (increase Y)
  1024.        8  BOUNDS_RESET. If set the accumulator registers are reset to
  1025.             Left=2047, Top=2047, Right=-2048, Bottom=-2048
  1026.     9-10  CLIP_MODE.
  1027.             0: Clip exception disabled
  1028.             1: Stroked line segments
  1029.             2: Polygon boundary lines
  1030.             3: Patterned lines
  1031.  
  1032. A6EEh W(W):  Destination Start X Register                           (Mach8/32)
  1033. bit 0-10  DEST_X_START. Starting X coordinate for the destination blit
  1034.  
  1035. AAEEh W(W):  Destination X End Register                             (Mach8/32)
  1036. bit 0-10  DEST_X_END. Ending X coordinate of each row of the destination blit
  1037.  
  1038. AEEEh W(W):  Destination Y End Register                             (Mach8/32)
  1039. bit 0-10  DEST_Y_END. Ending line of the destination blit for VRAM to VRAM
  1040.  
  1041. B2EEh W(R):  R Horizontal Displayed & Total Register                  (Mach32)
  1042. bit  0-7  H_DISP. Pixels displayed horizontally, in units of 8 pixels.
  1043.           This field is written at 6E8h
  1044.     8-15  H_TOTAL. Total horizontal screen width in units of 8 pixels.
  1045.           This field is written at 2E8h
  1046.  
  1047. B2EEh W(W):  Source X Start Register                                (Mach8/32)
  1048. bit 0-10  SRC_X_START. First pixel of the blit area (except first row)
  1049.  
  1050. B6EEh (R):  Horizontal Sync Start Register                            (Mach32)
  1051. bit  0-7  H_SYNC_STRT. HSync start in units of 8 pixels.
  1052. Note: This register is written at 0AE8h
  1053.  
  1054. B6EEh (W):  Background Function Register                            (Mach8/32)
  1055. bit  0-4  ALU_BG_FN. Background ALU function code
  1056.  
  1057. BAEEh (R):  Horizontal Sync Width Register                            (Mach32)
  1058. bit  0-4  H_WIDTH. Width of the sync in units of 8 pixels
  1059.        5  H_POLARITY. Set for negative Horizontal sync polarity, clear for
  1060.           positive Horizontal sync
  1061. Note: This register is written at 0EE8h
  1062.  
  1063. BAEEh (W):  Foreground Function Register                            (Mach8/32)
  1064. bit  0-4  ALU_FG_FN. Foreground ALU function code.
  1065.  
  1066. BEEEh W(W):  Source X End Register                                  (Mach8/32)
  1067. bit 0-10  SRC_X_END. Last pixel of the blit source area
  1068.  
  1069. C2EEh W(R):  Vertical Total Register                                  (Mach32)
  1070. bit 0-11  V_TOTAL. Total number of scanlines in a frame.
  1071. Note: This register is written at 12E8h
  1072.  
  1073. C2EEh (W):  Source Y Direction Register                             (Mach8/32)
  1074. bit    0  SRC_Y_DIR. Direction of drawing. Set for top-to-bottom, clear for
  1075.           bottom-to-top.
  1076.  
  1077. C6EEh W(R):  Vertical Displayed Register                              (Mach32)
  1078. bit 0-11  V_DISP. Number of scanlines displayed (-1).
  1079. Note: This register is written at 16E8h
  1080.  
  1081. C6EEh W(W):  Extended Short Stroke Vector Transfer Register         (Mach8/32)
  1082. bit  0-3  Length of the major axis
  1083.        4  Set for drawing, clear for moves
  1084.      5-7  Direction in degrees:
  1085.             0: 0, 1: 45, 2: 90, 3: 135, 4: 180, 5: 225, 6: 270, 7: 315
  1086.     8-15  Same as bits 0-7, but another vector.
  1087. Note: this is similar to 9EE8h
  1088.  
  1089. CAEEh W(R):  Vertical Sync Start Register                             (Mach32)
  1090. bit 0-11  V_SYNC_STRT. Vertical sync start in scanlines
  1091. Note: This register is written at 1AE8h
  1092.  
  1093. CAEEh W(W):  Scan To X Register                                      (Mach8/32
  1094. bit 0-10  SCAN_TO_X. Can be used for fast polygon scan conversion and
  1095.           horizontal lines. Drawn from current X position to this position.
  1096.           Left edge drawn, right edge not drawn.
  1097.  
  1098. CEEEh W(R):  Vertical Line Counter Register                           (Mach32)
  1099. bit 0-10  VERT_LINE_CNTR. Vertical Line Counter
  1100.  
  1101. CEEEh W(W):  Data Path Configuration Register                       (Mach8/32)
  1102. bit    0  READ_WRITE. If set data is written to the drawing trajectory, if
  1103.           clear read from it.
  1104.        1  POLY_FILL_MODE. If set Polygon-fill blit mode is enabled, blit
  1105.           source mechanism is triggered and VRAM source blit data is used as
  1106.           the polygon fill mask, if clear polygon-fill blit mode is disabled
  1107.           Cleared at the start of each row of the blit.
  1108.        2  READ_MODE. If set read host data is monochrome, if clear color.
  1109.        4  DRAW. Enable Draw if set.
  1110.      5-6  MONO_SRC. Monochrome source is:
  1111.             0: Always "1"
  1112.             1: Mono Pattern register
  1113.             2: Pixel Transfer register
  1114.             3: VRAM blit source
  1115.      7-8  BG_COLOR_SRC. Background Color Source select.
  1116.             0: Background color register
  1117.             1: Foreground color register
  1118.             2: Pixel transfer register
  1119.             3: VRAM blit source
  1120.        9  DATA_WIDTH. Width of the data transferred through the CPU Data
  1121.           Transfer register. 0: 8bit, 1: 16bit
  1122.           Should be set in 16bit/pixel modes.
  1123.       12  LSB_FIRST. If set the CPU Data Transfer register is "Intel little
  1124.           endian style" (least significant byte first), if clear in "Motorola
  1125.           big endian style" (most significant byte first).
  1126.           In Mach8 mode this bit is ignored if bit 9 is 0.
  1127.    13-15  FG_COLOR_Src. Foreground color source select.
  1128.             0: Background color register
  1129.             1: Foreground color register
  1130.             2: Pixel transfer register
  1131.             3: VRAM blit source
  1132.             5: Color pattern shift register
  1133.  
  1134. D2EEh W(R):  Vertical Sync Width Register                             (Mach32)
  1135. bit  0-4  V_WIDTH. Width of Vsync pulse in scanlines
  1136.        5  V_POLARITY. Set for negative Vsync, clear for positive Vsync
  1137. Note: This register is written at 1EE8h
  1138.  
  1139. D2EEh W(W):  Pattern Length Register                                (Mach8/32)
  1140. bit  0-4  PATT_LENGTH. Number of pixels (-1) in the pattern
  1141.        7  8x8 Mono Pattern Enable. If set bits 0-4 are ignored and Pattern
  1142.           Data index 10h-17h are used as an 8x8 rectangular pattern
  1143.       15  8x8 Block Write Mono Pattern Enable. If set the 8x8 pattern
  1144.           described in bit 7 is used as a transparency mask for the write
  1145.  
  1146. D6EEh (W):  Pattern Index Register                                  (Mach8/32)
  1147. bit  0-4  PATT_INDEX. Selects the first pixel in the color or mono pattern for
  1148.           the destination
  1149.  
  1150. DAEEh W(R):  Read Source X Register                                 (Mach8/32)
  1151. bit 0-10  R_SRC_X. Source current X. This register is written at 8EE8h
  1152.  
  1153. DAEEh W(W):  Extended Left Scissor Register                         (Mach8/32)
  1154. bit 0-11  EXT_SCISSOR_L. Left scissor (-2048..2047)
  1155.  
  1156. DEEEh W(R):  Read Source Y Register                                 (Mach8/32)
  1157. bit 0-10  R_SRC_Y. Source current Y. This register is written at 8AE8h
  1158.  
  1159. DEEEh W(W):  Extended Top Scissor Register                          (Mach8/32)
  1160. bit 0-11  EXT_SCISSOR_T. Top scossor (-2048..2047)
  1161.  
  1162. E2EEh W(W):  Extended Right Scissor Register                        (Mach8/32)
  1163. bit 0-11  EXT_SCISSOR_R. Right scissor (-2048..2047)
  1164.  
  1165. E6EEh W(W):  Extended Bottom Scissor Register                       (Mach8/32)
  1166. bit 0-11  EXT_SCISSOR_B. Bottom Scissor (-2048..2047)
  1167.  
  1168. EEEEh W(W):  Destination Color Compare Function Register            (Mach8/32)
  1169. bit  3-5  DEST_CMP_FN_4/8. 4/8bit mode destination compare function code
  1170.             0:  False
  1171.             1:  True
  1172.             2:  Destination pixel >= DEST_CMP_CLR
  1173.             3:  Destination pixel <  DEST_CMP_CLR
  1174.             4:  Destination pixel != DEST_CMP_CLR
  1175.             5:  Destination pixel =  DEST_CMP_CLR
  1176.             6:  Destination pixel <= DEST_CMP_CLR
  1177.             7:  Destination pixel >  DEST_CMP_CLR
  1178.           The pixels where the comparison is true are NOT updated.
  1179.      6-8  DEST_CMP_FN_B. 16bit blue destination compare function code
  1180.     9-11  DEST_CMP_FN_G. 16bit green destination compare function code
  1181.    12-14  DEST_CMP_FN_R. 16bit red destination compare function code
  1182.  
  1183. F2EEh W(R/W):  Destination Color Compare Function Register         (68800-6 +)
  1184. bit 0-15  Destination Color Compare Mask
  1185.  
  1186. FAEEh W(R):  Chip ID Register                                      (68800-6 +)
  1187. bit 0-9  CHIP_CODE. Identifies the chip version:
  1188.            017h  68800-AX
  1189.            177h  68800-LX
  1190.            2F7h  68800-6
  1191.          The 68800-3 appears to return 0 for this field (undocumented)
  1192.   10-11  CHIP_CLASS.
  1193.   12-15  CHIP_REV.
  1194.  
  1195. FEEEh W(W):  Linedraw Register                                      (Mach8/32)
  1196. bit 0-15  Line data. 9AEEh determines which type of line data is written
  1197.  
  1198.  
  1199.  
  1200. Bank Switching
  1201.  
  1202.   Bank switching can use either one single bank register or two
  1203.   separate read and write bank registers (18800-2 and 28800 Only).
  1204.   Banks map to 64k boundaries.
  1205.  
  1206. Reserved locations in the ROM (typically starting at C000h:0):
  1207.  
  1208.   $10   2 bytes   ATI Register (usually $1CE).
  1209.   $31   9 bytes   '761295520' ID's ATI product
  1210.   $40   2 bytes   '31' = ATI VGA Wonder/Mach series
  1211.                   '32' = ATI EGA Wonder 800+
  1212.                   '34' = ATI VGA Basic-16
  1213.                   '22' = ATI EGA Wonder
  1214.                  ?+'3' = ATI Basic-16
  1215.   $42   1 byte    Bit 0  Set for 16-bit boards
  1216.                       1  Mouseport present if set
  1217.                       2  Use hardware detection to detect mouse port if set
  1218.                       3  Microchannel if set, PC/AT else
  1219.                       4  Use clock chip if set
  1220.                       7  Use C000:0000 to D000:FFFF with 16 bit ROM if set
  1221.   $43   1 byte    Gate revision.
  1222.                    ' ' (20h) = Mach64 (see Mach64 section below)
  1223.                    '1' (31h) = 18800   (V3),
  1224.                    '2' (32h) = 18800-1 (V4/V5),
  1225.                    '3' (33h) = 28800-2  VGA Wonder+ (V6).
  1226.                    '4' (34h) = 28800-4  VGA Wonder (1MB)
  1227.                    '5' (35h) = 28800-5  VGA Wonder 1MB/XL
  1228.                    '6' (36h) = 28800-6  VGA Wonder XL
  1229.                    'a' (61h) = 68800    Mach-32
  1230.                    'c' (63h) = 68800    Mach-32 - Which version ?
  1231.   $44   1 byte    Bit 0  If clear the board can support 70Hz
  1232.                          non-interlaced refresh
  1233.                       1  If set the board supports Korean characters in VGA
  1234.                          mode
  1235.                       2  If set the board uses 45MHz memory clock, if clear
  1236.                          40MHz
  1237.                       3  If clear the board supports zero wait states.
  1238.                       4  If set the board uses paged ROMs.
  1239.                       6  If clear there is 8514/A hardware on board (Graphics
  1240.                          Ultra)
  1241.                       7  If set there is a 32K color DAC on board.
  1242.   $4C   1 byte    Major Bios version
  1243.   $4D   1 byte    Minor Bios version
  1244.  
  1245.   $64  (Mach32) Far call entry point to Load Shadow Set function
  1246.        AH = 0
  1247.   $68  (Mach32) Far call entry point to Set Mode function
  1248.        AL = 00h  Load VGA passthrough mode
  1249.             01h  Load low resolution mode
  1250.             02h  Load high resolution mode
  1251.  
  1252.   $6C  (Mach32) Far call entry point to Query function
  1253.        AL = 00h  Query information structure in bytes
  1254.                  Returns size in AX
  1255.             01h  Query device long
  1256.                  ES:BX -> Device Status Table to be filled out
  1257.                  OFFSET  TYPE   Description:
  1258.                    00h   WORD   Size of structure in bytes
  1259.                    02h   BYTE   Revision of structure
  1260.                    03h   BYTE   Number of mode tables
  1261.                    04h   WORD   Offset of mode tables
  1262.                    06h   BYTE   Size of mode tables in bytes
  1263.                    07h   BYTE   ASIC Revision
  1264.                    08h   BYTE   Status Flags
  1265.                                 Bit 0  Host data transfers forced to 8bit
  1266.                    09h   BYTE   VGA Type. 0: Disabled, 1: Enabled
  1267.                    0Ah   BYTE   VGA Boundary. 0: 0K, 1: 256K, 2: 512K,
  1268.                                   3: 768K, 4: 1M, 0FFh: Full access
  1269.                    0Bh   BYTE   Memory Size.
  1270.                                   0: 256K, 1: 512K, 2: 1M, 3: 2M, 4: 4M
  1271.                    0Ch   BYTE   DAC Type
  1272.                                   0: ATI68830
  1273.                                   1: SC1148x
  1274.                                   2: ATI68875, TLC34075
  1275.                                   3: Bt476,Bt478
  1276.                                   4: Bt481,Bt482
  1277.                                   5: ATI68860 (68800-AX only)
  1278.                    0Dh   BYTE   Memory Type: See 12EEh bits 4-6 for details
  1279.                    0Eh   BYTE   Bus Type:
  1280.                                   0: 16bit ISA
  1281.                                   1: EISA
  1282.                                   2: 16bit Micro Channel
  1283.                                   3: 32bit Micro Channel
  1284.                                   4: Local bus (386SX)
  1285.                                   5: Local bus (386DX)
  1286.                                   6: Local bus (486)
  1287.                    0Fh   BYTE   Monitor Alias
  1288.                    10h   WORD   Shadow 1 Status
  1289.                    12h   WORD   Shadow 2 Status
  1290.                    14h   WORD   Aperture Address (0MB - 4095MB)
  1291.                    16h   BYTE   Aperture Configuration
  1292.                                 Bit 0-1  0: Disabled, 1: 1MB, 2: 4MB
  1293.                    17h   BYTE   Mouse Configuration
  1294.                                 Bit 0-1  Mouse Address Selection
  1295.                                            0: Disabled
  1296.                                            1: Secondary Address
  1297.                                            2: Primary Address
  1298.                                     2-3  Interrupt handler selection
  1299.                                            0: IRQ5, 1: IRQ4, 2: IRQ3, 3: IRQ2
  1300.                    18h   BYTE   DAC Support
  1301.                                 Bit 0  Supports (664) if set
  1302.                                     1  Supports (655) if set
  1303.                                     2  Supports (565) if set
  1304.                                     3  Supports (555) if set
  1305.                                     5  Supports 32bpp if set
  1306.                                     6  Supports BGR if set
  1307.                                     7  Supports RGB if set
  1308.                  A number of mode tables follows:
  1309.                  OFFSET  TYPE   Description:
  1310.                    00h   WORD   Number of pixels horizontally
  1311.                    02h   WORD   Number of lines vertically
  1312.                    04h   BYTE   Maximum pixel depth
  1313.                    05h   BYTE   Status Flags
  1314.                                 Bit 0  Nonlinear Y addressing mode if set
  1315.                                     6  MUX mode if set
  1316.                                     7  PCLK divided by 2 if set
  1317.                    06h   DWORD  Reserved
  1318.                    0Ah   WORD   (4AEEh) CLOCK_SELECT
  1319.                    0Ch   BYTE   (02E8h) H_TOTAL
  1320.                    0Dh   BYTE   (06E8h) H_DISP
  1321.                    0Eh   BYTE   (0AE8h) H_SYNC_STRT
  1322.                    0Fh   BYTE   (22E8h) DISP_CNTL
  1323.                    10h   BYTE   (0EE8h) H_SYNC_WID
  1324.                    11h   BYTE   (1EE8h) V_SYNC_WID
  1325.                    12h   WORD   (12E8h) V_TOTAL
  1326.                    14h   WORD   (16E8h) V_DISP
  1327.                    16h   WORD   (1AE8h) V_SYNC_STRT
  1328.                    18h   WORD   (62EEh) HORIZONTAL_OVERSCAN
  1329.                    1Ah   WORD   (66EEh) VERTICAL_OVERSCAN
  1330.                    1Ch   BYTE   (02EEh) OVERSCAN_COLOR_8
  1331.                    1Dh   BYTE   (02EFh) OVERSCAN_COLOR_BLUE
  1332.                    1Eh   BYTE   (06EEh) OVERSCAN_COLOR_GREEN
  1333.                    1Fh   BYTE   (06EFh) OVERSCAN_COLOR_RED
  1334.             02h  Query device short
  1335.                  Returns:
  1336.                  AL = ASIC revision
  1337.                  AH = Aperture Configuration
  1338.                  BX = Aperture Address
  1339.                  CL = Mouse Configuration
  1340.                  CH = DAC type
  1341.  
  1342.   $70  (Mach32) Far call entry point to Accelerator service function
  1343.        AH = 00h  Reset accelerator
  1344.             01h  Set DAC to default colors
  1345.             02h  EEPROM services
  1346.                  AL = 00h  Read from EEPROM (returns result in AX)
  1347.                       01h  Write to EEPROM
  1348.                  BX = EEPROM word address
  1349.                  DX = Data to write
  1350.  
  1351. EEPROM Map (Mach32):
  1352. Word:  Bits:  Description
  1353.  00h   0-15   EEPROM Write Counter
  1354.  01h    0-7   Int Handler Select.
  1355.                 20h: IRQ5, 28h: IRQ4, 30h: IRQ3, 38h: IRQ2
  1356.        8-15   Mouse Address Select
  1357.                 00h: Disabled, 08h: Secondary Address, 18h: Primary Address
  1358.  02h      0   ROM 16bit access enabled if set
  1359.           1   Zero Waitstate ROM Enabled if set
  1360.           2   Zero Waitstate RAM Enabled if set
  1361.           3   VGA bus I/O is 16bit if set, 8bit if clear
  1362.           4   Power Up Font. 0: 8x14 or 9x14, 1: 8x16 or 9x16
  1363.           5   Dual Monitor Enable
  1364.         6-7   Mono Color Select
  1365.                 0: White, 1: Green, 2: Amber
  1366.        8-15   Power Up Video Mode:
  1367.                 03h  VGA Color - secondary
  1368.                 05h  VGA mono  - secondary
  1369.                 07h  VGA lores Color - primary
  1370.                 09h  VGA hires Color - primary
  1371.                 0Bh  VGA mono - primary
  1372.                 12h  EGA lores Color - secondary
  1373.                 13h  EGA hires Color - secondary
  1374.                 15h  EGA mono - secondary
  1375.                 17h  EGA lores Color - primary
  1376.                 19h  EGA hires Color - primary
  1377.                 1Bh  EGA mono - primary
  1378.                 20h  CGA
  1379.                 30h  Hercules 720x348
  1380.                 40h  Hercules 640x400
  1381.  03h    0-3   EEPROM table revision number
  1382.          14   Korean BIOS support
  1383.          15   Scrolling Fix enable
  1384.  04h   0-15   Custom Monitor Indices
  1385.  05h    0-2   Monitor Alias
  1386.           3   Alias Enable
  1387.         4-6   VGA Boundary. 0: Shared, 1: 256K, 2: 512K, 4: 1MB
  1388.        8-13   Monitor Code
  1389.       14-15   Host Data Transfer Width. 0: Auto Select, 1: 16bit, 2: 8bit
  1390.                 3: 8bit host data/16bit other
  1391.  06h    0-3   Aperture Size. 0: Disabled, 1: 1MB, 2: 4MB
  1392.        4-15   Aperture Location in Mbytes
  1393.  07h      0   640x480 72Hz enable
  1394.           1   Use Stored Parameters for 640x480
  1395.        8-15   Offset to 640x480 table in WORDs
  1396.  08h      0   800x600 95Hz (interlaced) enable
  1397.           1   800x600 89Hz (interlaced) enable
  1398.           2   800x600 56Hz enable
  1399.           3   800x600 60Hz enable
  1400.           4   800x600 70Hz enable
  1401.           5   800x600 72Hz enable
  1402.           7   Use Stored Parameters for 800x600
  1403.        8-15   Offset to 800x600 table in WORDs
  1404.  09h      0   1024x768 87Hz (interlaced) enable
  1405.           1   1024x768 60Hz enable
  1406.           2   1024x768 70Hz enable
  1407.           3   1024x768 72Hz enable
  1408.           4   1024x768 66Hz enable (not active)
  1409.           7   Use Stored Parameters for 1024x768
  1410.        8-15   Offset to 1024x768 table in WORDs
  1411.  0Ah      0   1280x1024 87Hz (interlaced) enable
  1412.           1   1280x1024 95Hz (interlaced) enable
  1413.           7   Use Stored Parameters for 1280x1024
  1414.        8-15   Offset to 1280x1024 table in WORDs
  1415.  0Bh      0   1120x750 enable
  1416.           1   1152x900 enable
  1417.           7   Use Stored Parameters for alternate modes
  1418.        8-15   Offset to alternate table in WORDs
  1419.  0Dh-1Bh         CRT Parameter Table 1
  1420.  1Ch-2Ah         CRT Parameter Table 2
  1421.  2Bh-39h         CRT Parameter Table 3
  1422.  3Ah-48h         CRT Parameter Table 4
  1423.  49h-57h         CRT Parameter Table 5
  1424.  58h-66h         CRT Parameter Table 6
  1425.  67h-75h         CRT Parameter Table 7
  1426.  7Eh   8-10   DAC Type. See 12EEh bit 9-11 for details
  1427.       11-13   Memory Size. See 12EEh bit 4-6 for details
  1428.          14   VGA enable
  1429.  7Fh   0-15   EEPROM Checksum
  1430.  
  1431. CRT Table structure:
  1432. Word:  Bits:  Description
  1433.  00h    0-3   Clock Chip Sel
  1434.         4-5   Clock Div
  1435.           6   CRTC Usage. Set to use all CRTC parameters in EEPROM, clear to
  1436.               only use sync polarities
  1437.           7   Dot Clock Selects.
  1438.                 0: Use default dot clock
  1439.                 1: Use user supplied dot clock
  1440.           8   Parm Type. Set if WORDs 1-9 are 8514 data, clear if VGA data
  1441.        9-11   Maximum Pixel Depth. 0: 8bits/pixel, 1: 16b/p, 2: 24b/p
  1442.          12   MUX Mode
  1443.          13   Interlace
  1444.          14   Horizontal Sync Polarity
  1445.          15   Vertical Sync Polarity
  1446. If WORD 00h bit 8 is clear (VGA data):
  1447.  01h    0-7   Video Mode Sel 2
  1448.        8-15   Video Mode Sel 1
  1449.  02h    0-7   Video Mode Sel 4
  1450.        8-15   Video Mode Sel 3
  1451.  03h    0-7   Vertical Total (3d4h index 6)
  1452.        8-15   Horizontal Total (3d4h index 0)
  1453.  04h    0-7   Horizontal Retrace End (3d4h index 5)
  1454.        8-15   Horizontal Retrace Start (3d4h index 4)
  1455.  05h    0-7   Vertical Retrace End (3d4h index 11h)
  1456.        8-15   Vertical Retrace Start (3d4h index 10h)
  1457.  06h    0-7   Horizontal Blank End (3d4h index 3)
  1458.        8-15   Horizontal Blank Start (3d4h index 2)
  1459.  07h    0-7   Vertical Blank End (3d4h index 16h)
  1460.        8-15   Vertical Blank Start (3d4h index 15h)
  1461.  08h    0-7   Maximum Scanline (3d4h index 9)
  1462.        8-15   CRT Overflow (3d4h index 18h)
  1463.  09h    0-7   CRT Mode (3d4h index 17h)
  1464.        8-15   Vertical Displayed (3d4h index 12h)
  1465. If WORD 00h bit 8 is set (8514 data):
  1466.  02h    0-7   VFIFO_16
  1467.        8-15   VFIFO_24
  1468.  03h    0-7   (06E8h) H_DISP
  1469.        8-15   (02E8h) H_TOTAL
  1470.  04h    0-7   (0EE8h) H_SYNC_WID
  1471.        8-15   (0AE8h) H_SYNC_STRT
  1472.  05h   0-15   (12E8h) V_TOTAL
  1473.  06h   0-15   (16E8h) V_DISP
  1474.  07h   0-15   (1AE8h) V_SYNC_STRT
  1475.  08h    0-7   (22E8h) DISP_CNTL
  1476.        8-15   (1EE8h) V_SYNC_WID
  1477.  09h   0-15   (4AEEh) CLOCK_SEL
  1478. Common data again:
  1479.  0Ah    0-7   Offset to alternate table
  1480.        8-13   Size of mode tables in WORDs
  1481.          14   MUX flag
  1482.          15   PCLK/2 flag
  1483.  0Bh   0-15   (62EEh) HORIZONTAL_OVERSCAN
  1484.  0Ch   0-15   (66EEh) VERTICAL_OVERSCAN
  1485.  0Dh    0-7   (02EEh) OVERSCAN_COLOR_8
  1486.        8-15   (02EFh) OVERSCAN_COLOR_BLUE
  1487.  0Eh    0-7   (06EEh) OVERSCAN_COLOR_GREEN
  1488.        8-15   (06EFh) OVERSCAN_COLOR_RED
  1489.  
  1490.  
  1491.  
  1492.   ** Mach64 Registers **
  1493.  
  1494. The Mach64 engine is different from the Mach8/Mach32. The Mach64 has a number
  1495. of 32bit registers. Most are I/O mapped at x2ECh (A2-A9 = 10111011), and all
  1496. except the Config_Ctrl Register (6AECh) is memory mapped as a 1KB block,
  1497. either at 0BFC00h or the last 1KB of the Linear Aperture.
  1498.  
  1499. 6AECh D(R/W):  Config_Ctrl
  1500. bit   0-1  Cfg_Mem_Ap_Size. Linear Memory Aperture Size.
  1501.             0: Disabled, 1: 4MB Aperture, 2: 8MB Aperture
  1502.         2  Cfg_Mem_VGA_Ap_En. VGA Aperture enabled if set
  1503.      4-13  Cfg_Mem_Ap_Loc. Linear Memory Aperture Location in units of 4MB.
  1504.            Bit 4 (lowest bit) is ignored for 8MB Apertures.
  1505.     16-18  Cfg_Card_ID.
  1506.        19  Cfg_VGA_Dis. VGA enabled if clear, disabled if set
  1507.  
  1508. M+000h/02ECh D(R/W):  Crtc_H_Total_Disp
  1509. bit   0-7  Crtc_H_Total. Horizontal Total in character clocks (8 pixel units)
  1510.     16-23  Crtc_H_Disp. Horizontal Display End in character clocks.
  1511.  
  1512. M+004h/06ECh D(R/W):  Crtc_H_Sync_Strt_Wid
  1513. bit   0-7  Crtc_H_Sync_Strt. Horizontal Sync Start in character clocks (8
  1514.            pixel units)
  1515.      8-10  Crtc_H_Sync_Dly. Horizontal Sync Start delay in pixels
  1516.     16-20  Crtc_H_Sync_Wid. Horizontal Sync Width in character clocks
  1517.        21  Crtc_H_Sync_Pol. Horizontal Sync Polarity
  1518.  
  1519. M+008h/0AECh D(R/W):  Crtc_V_Total_Disp
  1520. bit  0-10  Crtc_V_Total. Vertical Total
  1521.     16-26  Crtc_V_Disp. Vertical Displayed End
  1522.  
  1523. M+00Ch/0EECh D(R/W):  Crtc_V_Sync_Strt_Wid
  1524. bit  0-10  Crtc_V_Sync_Strt. Vertical Sync Start
  1525.     16-20  Crtc_V_Sync_Wid. Vertical Sync Width
  1526.        21  Crtc_V_Sync_Pol. Vertical Sync Polarity
  1527.  
  1528. M+010h/12ECh D(R/W):  Crtc_Vline_Crnt_Vline
  1529. bit  0-10  The line at which Vertical Line interrupt is triggered
  1530.     16-26  (R) Crtc_Crnt_Vline. The line currently being displayed
  1531.  
  1532. M+014h/16ECh D(R/W):  Crtc_Off_Pitch
  1533. bit  0-19  Crtc_Offset. Display Start Address in units of 8 bytes.
  1534.     22-31  Crtc_Pitch. Display pitch in units of 8 pixels
  1535.  
  1536. M+018h/1AECh D(R/W):  Crtc_Int_Cntl
  1537. bit     0  (R) Crtc_Vblank. Vertical Blank
  1538.         1  Crtc_Vblank_Int_En. Vertical Blank interrupt enable
  1539.         2  Crtc_Vblank_Int. When read returns the status of the Vertical Blank
  1540.            interrupt, when written (with a 1 ??) acknowledges the interrupt.
  1541.         3  Crtc_Vline_Int_En. Vertical Line Interrupt enable.
  1542.         4  Crtc_Vline_Int.  When read returns the status of the Vertical Line
  1543.            interrupt, when written (with a 1 ??) acknowledges the interrupt.
  1544.         5  (R) Crtc_Vline_Sync. 0: Even scan line, 1: Odd scan line
  1545.         6  (R) Crtc_Frame. Interlaced frame. 0: Even frame, 1: Odd frame
  1546.  
  1547. M+01Ch/1EECh D(R/W):  Crtc_Gen_Cntl
  1548. bit     0  Crtc_Dbl_Scan_En. Enables double scan
  1549.         1  Crtc_Interlace_En. Enables interlace.
  1550.         2  Crtc_Hsync_Dis. Disables Horizontal Sync output
  1551.         3  Crtc_Vsync_Dis. Disables Vertical Sync output
  1552.         4  Crtc_Csync_En. Enable composite sync on Horizontal Sync output
  1553.         5  Crtc_Pic_By_2_En. CRTC advances 2 pixels per pixel clock
  1554.      8-10  Crtc_Pix_Width. Displayed bits/pixel: 1: 4bpp, 2: 8bpp, 3: 15bpp
  1555.             (5:5:5), 4: 16bpp (5:6:5), 5: 24bpp(undoc), 6: 32bpp
  1556.        11  Crtc_Byte_Pix_Order. Pixel order within each byte (4bpp).
  1557.             0: High nibble displayed first, 1: low nibble displayed first
  1558.     16-19  Crtc_Fifo_Lwm. Low Water Mark of the 16entry deep display FIFO.
  1559.            Only used in DRAM configurations. The minimum number of entries
  1560.            remaining in the FIFO before the CRTC starts refilling. Ideally
  1561.            should be set to the lowest number that gives a stable display.
  1562.        24  Crtc_Ext_Disp_En. 1:Extended display mode , 0:VGA display mode
  1563.        25  Crtc_En. Enables CRTC if set, resets if clear
  1564.  
  1565. M+040h/22ECh D(R/W):  Ovr_Clr
  1566. bit   0-7  Ovr_Clr_8. Overscan color for 4bpp  and 8bpp
  1567.      8-15  Ovr_Clr_B. Blue component of the Overscan Color
  1568.     16-23  Ovr_Clr_G. Green component of the Overscan Color
  1569.     24-31  Ovr_Clr_R. Red component of the Overscan Color
  1570.  
  1571. M+044h/26ECh D(R/W):  Ovr_Wid_Left_Right
  1572. bit   0-3  Ovr_Wid_Left. Left overscan width in character clocks
  1573.     16-19  Ovr_Wid_Right. Right overscan width in character clocks
  1574.  
  1575. M+048h/2AECh D(R/W):  Ovr_Wid_Top_Bottom
  1576. bit   0-7  Ovr_Wid_Top. Top overscan width in lines
  1577.     16-23  Ovr_Wid_Bottom. Bottom overscan width in lines
  1578.  
  1579. M+060h/2EECh D(R/W):  Cur_Clr0
  1580. bit   0-7  Cur_Clr0_8. Cursor color 0 for 4bpp and 8bpp modes
  1581.      8-15  Cur_Clr0_B. Blue component of the Cursor Color 0
  1582.     16-23  Cur_Clr0_G. Green component of the Cursor Color 0
  1583.     24-31  Cur_Clr0_R. Red component of the Cursor Color 0
  1584.  
  1585. M+064h/32ECh D(R/W):  Cur_Clr1
  1586. bit   0-7  Cur_Clr1_8. Cursor color 1 for 4bpp and 8bpp modes
  1587.      8-15  Cur_Clr1_B. Blue component of the Cursor Color 1
  1588.     16-23  Cur_Clr1_G. Green component of the Cursor Color 1
  1589.     24-31  Cur_Clr1_R. Red component of the Cursor Color 1
  1590.  
  1591. M+068h/36ECh D(R/W):  Cur_Offset
  1592. bit  0-19  Cur_Offset. Address of the cursor definition in units of 8 bytes
  1593.  
  1594. M+06Ch/3AECh D(R/W):  Cur_Horz_Vert_Posn
  1595. bit  0-10  Cur_Horz_Posn. Cursor Horizontal Position
  1596.     16-26  Cur_Vert_Posn. Cursor Vertical Position
  1597.  
  1598. M+070h/3EECh D(R/W):  Cur_Horz_Vert_Off
  1599. bit   0-5  Cur_Horz_Off. Cursor Horizontal Offset within the 64x64 cursor
  1600.     16-21  Cur_Vert_Offset. Cursor Vertical Offset within the 64x64 cursor.
  1601.  
  1602. M+080h/42ECh D(R/W):  Scratch_Reg0
  1603. bit  0-31  Scratch_Reg0. Available as scratch-pad.
  1604. Note: In test modes this address accesses one of the test registers.
  1605.  
  1606. M+080h/42ECh D(R/W):  Test_Reg0
  1607. bit  0-20  Test_Mem_Addr. Memory address for test mode 1, in units of 4 bytes
  1608. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1609.       22 = 1. This register is only intended for testing.
  1610.  
  1611. M+080h/42ECh D(R):  Test_Reg2
  1612. bit  0-14  Dst_X_Lnth_Cntr. Horizontal destination length counter
  1613.     16-30  Dst_Y_Lnth_Cntr. Vertical destination length counter
  1614. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1615.       22 = 2. This register is only intended for testing.
  1616.  
  1617. M+080h/42ECh D(R):  Test_Reg4
  1618. bit  0-12  Src_Read_Lnth_Cntr. Source FIFO read length counter
  1619. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1620.       22 = 3. This register is only intended for testing.
  1621.  
  1622. M+080h/42ECh D(R):  Test_Reg5
  1623. bit   0-7  Crtc_H_Char_Cntr. Horizontal CRTC character counter
  1624.      8-18  Crtc_V_Line_Cntr. Vertical CRTC line counter
  1625.     19-23  Crtc_H_Sync_Wid_Cntr. Horizontal CRTC Sync width counter
  1626.     24-28  Crtc_V_Sync_Wid_Cntr. Vertical CRTC Sync width counter
  1627. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1628.       22 = 4. This register is only intended for testing.
  1629.  
  1630. M+080h/42ECh D(R):  Test_Reg7
  1631. bit  0-23  Pixel_Data_Crc. CRC of the displayed pixel data, including overscan
  1632.            and cursor data.
  1633. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1634.       22 = 5. This register is only intended for testing.
  1635.  
  1636. M+084h/46ECh D(R/W):  Scratch_Reg1
  1637. bit  0-31  Scratch_Reg1. Available as scratch-pad.
  1638. Note: In test modes this address accesses one of the test registers.
  1639.  
  1640. M+084h/46ECh D(R/W):  Test_Reg1
  1641. bit  0-31  Test_Mem_Data. Data read or written to memory
  1642. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1643.       22 = 1. This register is only intended for testing.
  1644.  
  1645. M+084h/46ECh D(R):  Test_Reg3
  1646. bit  0-12  Src_X_Lnth_Cntr. Horizontal source length counter
  1647.     16-30  Src_Y_Lnth_Cntr. Vertical source length counter
  1648. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1649.       22 = 2. This register is only intended for testing.
  1650.  
  1651. M+084h/46ECh D(R):  Test_Reg6
  1652. bit     0  Crtc_H_Total_Eq. Set if Horizontal Counter = Crtc_H_Total
  1653.         1  Crtc_H_Total_Half_Eq. Set if Horizontal Counter = Crtc_H_Total/2
  1654.         2  Crtc_H_Disp_Eq. Set if Horizontal Counter = Crtc_H_Disp
  1655.         3  Crtc_H_Sync_Strt_Eq. Set if Horizontal Counter = Crtc_H_Sync_Strt
  1656.         4  Crtc_H_Sync_Wid_Eq. Set if Horizontal Sync Counter =
  1657.             Crtc_H_Sync_Wid
  1658.         5  Crtc_V_Total_Eq. Set if Vertical Counter = Crtc_V_Total.
  1659.         6  Crtc_V_Disp_Eq. Set if Vertical Counter = Crtc_V_Disp.
  1660.         7  Crtc_V_Sync_Strt_Eq. Set if Vertical Counter = Crtc_V_Sync_Strt.
  1661.         8  Crtc_V_Sync_Wid_Eq. Set if Vertical Sync Counter = Crtc_V_Sync_Wid.
  1662.         9  Crtc_V_Line_Eq. Set if Vertical Counter = Crtc_V_Line.
  1663.        10  Crtc_H_Disp_En. Horizontal Display Enable.
  1664.        11  Crtc_V_Disp_En. Vertical Display Enable.
  1665.        12  Crtc_Disp_En. Display Enable.
  1666.        13  Crtc_Blank. Display Blank.
  1667.        14  Crtc_H_Sync. Horizontal Sync.
  1668.        15  Crtc_V_Sync. Vertical Sync.
  1669.        16  Crtc_Frame. Odd/Even Frame. Changes when the line counter reaches
  1670.             the bottom (bit 5 of this register set)
  1671.        17  Crtc_Frame_X. Odd/Even Frame. Changes when the line counter reaches
  1672.             the end of display (bit 6 of this register set)
  1673.        18  Ovr_Left_Eq. Set if Horizontal Counter = Crtc_H_Total-Ovr_Wid_Left
  1674.        19  Ovr_Right_Eq. Set if Horizontal Counter = Crtc_H_Disp+Ovr_Wid_Right
  1675.        20  Ovr_Top_Eq. Set if Vertical Counter = Crtc_V_Total - Ovr_Wid_Top
  1676.        21  Ovr_Bottom_Eq. Set if Vertical Counter = Crtc_V_Total +
  1677.              Ovr_Wid_Bottom
  1678.        22  Ovr_Left_En. Left overscan enable
  1679.        23  Ovr_Right_En. Right overscan enable
  1680.        24  Ovr_Top_En. Top overscan enable
  1681.        25  Ovr_Bottom_En. Bottom overscan enable
  1682.        26  Ovr_En. Overscan Enable
  1683. Note: This register is only accessible if Gen_Test_Cntl (M+0D0h/66ECh) bit 20-
  1684.        22 = 4. This register is only intended for testing.
  1685.  
  1686. M+090h/4AECh D(R/W):  Clock_Cntl
  1687. bit   0-3  Clock_Sel. Clock select bit 0-3. Output to the clock chip
  1688.       4-5  Clock_Div. Internal clock divider. 0: no div, 1: /2, 2: /4
  1689.         6  (W) Clock_Strobe. Connected to the strobe or clk input on
  1690.             programmable clock chips
  1691.         7  Clock_Serial_Data. Data I/O for programmable clock chips
  1692.  
  1693. M+0A0h/4EECh D(R/W):  Bus_Cntl
  1694. bit   0-3  Bus_Ws. Bus wait states. Default = 15.
  1695.       4-7  Bus_Rom_Ws. ROM wait states. Default = 15
  1696.      8-11  Bus_Rom_Page. ROM page select.
  1697.        12  Bus_Rom_Dis. ROM Disabled if set
  1698.        13  Bus_IO_16_En. 16bit I/O enabled if set, 8bit if clear
  1699.        14  Bus_DAC_Snoop_En. DAC snooping enable
  1700.     16-19  Bus_Fifo_Ws. Max number of wait states the FIFO can generate when
  1701.            full before setting Buys_Fifo_Err_Int
  1702.        20  Bus_Fifo_Err_Int_En. Command FIFO error interrupt enable
  1703.        21  Bus_Fifo_Err_Int. When reading indicates whether a Command FIFO
  1704.            data error interrupt occoured (if set ?), when writing acknowledges
  1705.            (and clears?) the interrupt (if set ?).
  1706.        22  Bus_Host_Err_Int_En. Enable Command FIFO host data error interrupt
  1707.        23  Bus_Host_Err_Int. When reading indicates whether a Command FIFO
  1708.            host data error interrupt occoured (if set ?), when writing
  1709.            acknowledges (and clears?) the interrupt (if set ?).
  1710.     24-26  Bus_PCI_DAC_Ws. DAC wait states. Only valid for PCI bus systems.
  1711.        27  Bus_PCI_DAC_Dly. DAC access delayed. Only valid for PCI bus
  1712.            systems.
  1713.        28  Bus_PCI_Memw_Ws. If set use one wait state for memory writes, none
  1714.            if clear. Only valid for PCI bus systems.
  1715.        29  Bus_PCI_Burst_Dec. Inc/Decrement address for burst memory writes
  1716.            (only valid for PCI bus). 0: Increment, 1: Decrement
  1717.     30-31  Bus_Rdy_Read_Dly. Bus RDY delay for memory reads.
  1718.             0: RDY early by one memory clock cycle
  1719.             1: No RDY delay
  1720.             2: RDY delayed by one memory clock cycle
  1721.             3: RDY delayed by two memory clock cycles
  1722.  
  1723. M+0B0h/52ECh D(R/W):  Mem_Cntl
  1724. bit   0-2  Mem_Size. Video Memory Size. 0: 512K, 1: 1MB, 2: 2MB, 3: 4MB,
  1725.             4: 6MB, 5: 8MB
  1726.         4  Mem_Rd_Latch_En. Enables latching on RAM port data
  1727.         5  Mem_Rd_Latch_Dly. Delays latching of RAM port data by 1/2 memory
  1728.            clock period
  1729.         6  Mem_Sd_Latch_En. Enables latching of data on serial port data
  1730.         7  Mem_Sd_Latch_Dly. Delays latching of serial port data by 1/2 memory
  1731.            clock period
  1732.         8  Mem_Fill_Pls. One memory clock period set for width of data latch
  1733.            pulse
  1734.      9-10  Mem_Cyc_Lnth. memory cycle length for non-paged access:
  1735.              0: 5 mem clock periods, 1: 6 mem clks, 2: 7 mem clks
  1736.     16-17  Mem_Bndry. VGA/Mach Memory boundary. If the memory boundary is
  1737.            enabled (bit 18 is set) defines the amount of memory reserved for
  1738.            the VGA.  0: 0K, 1: 256K, 2: 512K, 3: 1M
  1739.        18  Mem_Bndry_En. If set the video memory is divided between the VGA
  1740.            engine and the Mach engine, with the low part reserved for the VGA
  1741.            engine, if clear they share the video memory
  1742.  
  1743. M+0B4h/56ECh D(R/W):  Mem_VGA_Wp_Sel
  1744. bit   0-7  Mem_VGA_Wps0. Selects the 32K block mapped for writing in the 1st
  1745.            half of the small aperture at A000h in units of 32K.
  1746.     16-23  Mem_VGA_Wps1. Selects the 32K block mapped for writing in the 2nd
  1747.            half of the small aperture at A800h in units of 32K.
  1748. Note: The small aperture is only available in accelerated modes and only if
  1749.       bit 2 of the Config_Cntl (6AECh) register is set.
  1750.  
  1751. M+0B8h/5AECh D(R/W):  Mem_VGA_Rp_Sel
  1752. bit   0-7  Mem_VGA_Rps0. Selects the 32K block mapped for reading in the 1st
  1753.            half of the small aperture at A000h in units of 32K.
  1754.     16-23  Mem_VGA_Rps1. Selects the 32K block mapped for reading in the 2nd
  1755.            half of the small aperture at A800h in units of 32K.
  1756. Note: The small aperture is only available in accelerated modes and only if
  1757.       bit 2 of the Config_Cntl (6AECh) register is set.
  1758.  
  1759. M+0C0h/5EECh D(R/W):  Dac_Regs
  1760. bit   0-7  Dac_W_Index. Accesses the same register as VGA I/O address 3C8h
  1761.      8-15  Dac_Data. Accesses the same register as VGA I/O address 3C9h
  1762.     16-23  Dac_Mask. Accesses the same register as VGA I/O address 3C6h
  1763.     24-31  Dac_R_Index. Accesses the same register as VGA I/O address 3C7h
  1764. Note: This is really 4 8bit registers corresponding to the VGA registers 3C6h-
  1765.       3C9h. Each byte accesses one of the 4 DAC registers. See VGA description
  1766.       of the registers 3C6h-3C9h, or the data on the specific DAC type, for
  1767.       details. Note that Dac_Cntl (M+0C4h/62ECh) bits 0-1 can be used in
  1768.       combination with this register to access up to 16 DAC registers.
  1769.  
  1770. M+0C4h/62ECh D(R/W):  Dac_Cntl
  1771. bit   0-1  Dac_Ext_Sel. Connected to the RS2 and RS3 inputs on the DAC.
  1772.         8  Dac_8bit_En. Enables 8bit DAC mode (256colors of 16M) if set
  1773.      9-10  Dac_Pix_Dly. Setup and hold time on pixel data. 0: None,
  1774.             1: 2ns - 4ns delay, 2: 4ns - 8ns delay
  1775.     11-12  Dac_Blank_Adj. Blank Delay in number of pixel clock periods.
  1776.             0: None, 1: 1 pixel clock, 2: 2 pixel clocks
  1777.        13  Dac_VGA_Adr_En. When bit 24 of Crtc_Gen_Cntl (M+01Ch/1EECh) is set,
  1778.            this bit enables access to the VGA DAC I/O addresses (3C6h-3C9h).
  1779.     16-18  Dac_Type. The DAC type - initialised from configuration straps on
  1780.            power-up. See Config_Stat0 (M+0E4h/72ECh) bits 9-11 for details
  1781.  
  1782. M+0D0h/66ECh D(R/W):  Gen_Test_Cntl
  1783. bit     0  Gen_EE_Data_Out. EEPROM data output
  1784.         1  Gen_EE_Clock. EEPROM clock output
  1785.         2  Gen_EE_Chip_Sel. EEPROM Chip Select.
  1786.         3  (R) Gen_EE_Data_In. Data input from the EEPROM
  1787.         4  Gen_EE_En. Enables EEPROM access
  1788.         5  Gen_Ovr_Output_En. Enables output of Overscan signal for external
  1789.            DAC
  1790.         6  Gen_Ovr_Polarity. Polarity of the external Overscan signal.
  1791.             0: Active high, 1: Active low
  1792.         7  Gen_Cur_En. Enables the Hardware Cursor if set
  1793.         8  Gen_Gui_En. Enables the drawing engine if set, resets it if clear
  1794.         9  Gen_Block_Wr_En. Enables Block Write Memory cycle
  1795.        16  Gen_Test_Fifo_En. Enables Draw engine testing of the Command FIFO
  1796.        17  Gen_Test_Gui_Regs_En. Enables loading of the drawing engine
  1797.            registers without triggering drawing operations or context switches
  1798.        18  Gen_Test_Vect_En. Enables the Bi-directional buses for 1 clock
  1799.            turn-around when switching from input to output.
  1800.        19  Gen_Test_Crc_Str. Pixel data CRC initialization strobe. Write 1 to
  1801.            reset the CRC accumulator, which will then calculate the CRC for
  1802.            the next frame displayed. The CRC value calculated includes
  1803.            Overscan and Hardware Cursor data.
  1804.     20-22  Gen_Test_Mode. Test Mode. 0: Disabled, 1: Memory Read/Write test,
  1805.             2: Draw engine dest/source length counter test, 3: Draw engine
  1806.            source read length counter test, 4: CRTC test, 5: Pixel data CRC
  1807.            test
  1808.        24  Gen_Test_Mem_Wr. Test Mode 1 (bits 20-22) cycle type:
  1809.              0: Read cycle, 1: Write cycle
  1810.        25  Gen_Test_Mem_Strobe. Writing a 1 will initiate a memory cycle if
  1811.            bits 20-22 = 1
  1812.        26  Gen_Test_Dst_Ss_En. Enables Destination trajectory controller
  1813.            single stepping if set. The engine processes multiple pixels in
  1814.            single steps for rectangular draw operations, while Bresenham line
  1815.            draw operations works on single pixels at a time.
  1816.        27  (W) Gen_Test_Dst_Ss_Strobe. Writing a 1 to this bit while bit 26 is
  1817.             set advances the drawing engine one step.
  1818.        28  Gen_Test_Src_Ss_En. Enables Source trajectory controller single
  1819.            stepping if set
  1820.        29  (W) Gen_Test_Src_Ss_Strobe. Writing a 1 to this bit while bit 28 is
  1821.             set advances the drawing engine one step.
  1822.        30  Gen_Test_Cc_En. Enables CRTC single stepping
  1823.        31  (W) Gen_Test_Cc_Strobe. Writing a 1 to this bit while bit 30 is set
  1824.              advances the CRTC one character clock.
  1825.  
  1826. M+0E0h/6EECh D(R):  Config_Chip_ID.
  1827. bit  0-15  Cfg_Chip_Type. Product Type Code. 0D7h for the 88800GX,
  1828.              57h for the 88800CX (guess)
  1829.     16-23  Cfg_Chip_Class. Class code
  1830.     24-31  Cfg_Chip_Rev. Revision code
  1831.  
  1832. M+0E4h/72ECh D(R):  Config_Stat0
  1833. bit   0-2  Cfg_Bus_Type. Host Bus type. 0: ISA, 1: EISA, 6: VLB, 7: PCI
  1834.       3-5  Cfg_Mem_Type. Memory Type. 0: DRAM (256Kx4), 1: VRAM (256Kx4, x8,
  1835.             x16), 2: VRAM (256Kx16 short shift reg), 3: DRAM (256Kx16),
  1836.             4: Graphics DRAM (256Kx16), 5: Enh VRAM (256Kx4, x8, x16), 6: Enh
  1837.             VRAM (256Kx16 short shift reg)
  1838.         6  Cfg_Dual_CAS_En. Dual CAS support enabled if set
  1839.       7-8  Cfg_Local_Bus_Option. Local Bus Option.
  1840.              1: Local option 1, 2: Local option 2, 3: Local option 3
  1841.      9-11  Cfg_Init_DAC_Type. DAC type. 2: ATI68875/TI 34075, 3: Bt476/Bt478,
  1842.              4: Bt481, 5: ATI68860/ATI68880, 6: STG1700, 7: SC15021
  1843.     12-14  Cfg_Init_Card_ID. Card ID. 0-6: Card ID 0-6, 7: Disable Card ID
  1844.        15  Cfg_Tri_Buf_Dis. Tri-stating of output buffers during reset
  1845.            disabled if set
  1846.     16-21  Cfg_Ext_ROM_Addr. Extended Mode ROM Base Address. Bits 12-17 of the
  1847.            ROM base address, 0: C0000h, 1: C1000h ... 3Fh: FE000h
  1848.        22  Cfg_ROM_Dis. Disables ROM if set
  1849.        23  Cfg_VGA_Enm. Enables VGA Controller
  1850.        24  Cfg_Local_Bus_Cfg. 0: Local Bus configuration 2, 1: configuration 1
  1851.        25  Cfg_Chip_En. Enables chip if set
  1852.        26  Cfg_Local_Read_Dly_Dis. If clear delays read cycle termination by 1
  1853.            bus clock, no delay if set
  1854.        27  Cfg_ROM_Option. ROM Address. 0: E0000h, 1: C0000h
  1855.        28  Cfg_Bus_option. EISA bus: Enables POS registers if set, disables
  1856.            POS registers and enables chip if clear.
  1857.            VESA Local Bus: Enables decode of I/O address 102h if clear,
  1858.            disables if set
  1859.        29  Cfg_Local_DAC_Wr_En. Enables local bus DAC writes if set
  1860.        30  Cfg_VLB_Rdy_Dis. Disables VESA local bus compliant RDY if set
  1861.        31  Cfg_Ap_4Gbyte_Dis. Disables 4GB Aperture Addressing if set
  1862.  
  1863. M+0E8h/76ECh D(R):  Config_Stat1
  1864. bit     0  Cfg_PCI_DAC_Cfg. If clear the DAC data bus is connected directly to
  1865.            the DAC, if set it is connected through a latch. Only valid for
  1866.            PCI bus systems.
  1867.  
  1868. M+100h D(R/W):  Dst_Off_Pitch
  1869. bit  0-19  Dst_Offset. Address of the Destination area in units of 8 bytes.
  1870.     22-31  Dst_Pitch. Destination Pitch in units of 8 pixels. In mono modes
  1871.            must be a multiplum of 64 pixels, in 4bpp modes a multiplum of 16
  1872.            pixels.
  1873.  
  1874. M+104h D(R/W):  Dst_X
  1875. bit  0-12  Dst_X. Destination X coordinate
  1876.  
  1877. M+108h D(R/W):  Dst_Y
  1878. bit  0-14  Dst_Y. Destination Y coordinate
  1879.  
  1880. M+10Ch D(W):  Dst_Y_X
  1881. bit  0-14  Dst_Y. Destination Y coordinate
  1882.     16-28  Dst_X. Destination X coordinate
  1883.  
  1884. M+110h D(R/W):  Dst_Width
  1885. bit  0-12  Dst_Width. Width of the destination area in pixels.
  1886.        31  Dst_Wid_Fill_Dis.  If clear the bitblt operation is started by
  1887.            writing to this register, if set draw is not started.
  1888.  
  1889. M+114h D(R/W):  Dst_Height
  1890. bit  0-14  Dst_Height. Height of the destination area in lines.
  1891.  
  1892. M+118h D(W):  Dst_Height_Width
  1893. bit  0-14  Dst_Height. Height of the destination area in lines.
  1894.     16-28  Dst_Width. Width of the destination area in pixels.
  1895. Note: Writing to this register initiates a rectangle fill
  1896.  
  1897. M+11Ch D(W):  Dst_X_Width
  1898. bit  0-12  Dst_X. Destination X coordinate
  1899.     16-28  Dst_Width. Destination width
  1900.  
  1901. M+120h D(R/W):  Dst_Bres_Lnth
  1902. bit  0-14  Dst_Bres_Lnth. Line length in pixels.
  1903.        31  Dst_Bres_Lnth_Line_Dis. If clear the line draw operation is started
  1904.            by writing to this register, if set draw is not started.
  1905. Note: Writing to this register starts the line draw, unless bit 31 is set.
  1906.  
  1907. M+124h D(R/W):  Dst_Bres_Err
  1908. bit  0-17  Dst_Bres_Err. Bresenham Error Term. Should be set to:
  1909.             2*min(abs(dX),abs(dY))-max(abs(dX),abs(dY)), where dX is the
  1910.            horizontal difference (in pixels) between the start and end point
  1911.            and dY the vertical difference.
  1912.  
  1913. M+128h D(R/W):  Dst_Bres_Inc
  1914. bit  0-17  Dst_Bres_Inc. Bresenham increment registers. Should be set to:
  1915.              2*min(abs(dX),abs(dY)), where dX is the horizontal difference (in
  1916.            pixels) between the start and end point and dY the vertical diff.
  1917.  
  1918. M+12Ch D(R/W):  Dst_Bres_Dec
  1919. bit  0-17  Dst_Bres_Dec. Bresenham decrement registers. Calculated as:
  1920.              2*(min(abs(dX),abs(dY))-max(abs(dX),abs(dY))), where dX is the
  1921.            horizontal difference (in pixels) between the start and end point
  1922.            and dY the vertical difference. Should be negative.
  1923.  
  1924. M+130h D(R/W):  Dst_Cntl
  1925. bit     0  Dst_X_Dir. Destination X dir. 0: Right to left, 1: Left to right
  1926.         1  Dst_Y_Dir. Destination Y dir. 0: Bottom to top, 1: Top to bottom.
  1927.         2  Dst_Y_Major. Destination Y Major axis (Bresenham linedraw).
  1928.             0: X is major axis, 1: Y is major axis
  1929.         3  Dst_X_Tile. Enable Rectangular tiling in the X direction if set.
  1930.            For rectangular destinations setting this bit causes the Dst_X
  1931.            register to have the value (Dst_X + Dst_Width) after the blit.
  1932.         4  Dst_Y_Tile. Enable Rectangular tiling in the Y direction if set.
  1933.            For rectangular destinations setting this bit causes the Dst_Y
  1934.            register to have the value (Dst_Y + Dst_Height) after the blit.
  1935.         5  Dst_Last_Pel. Enable Destination last Pel. If set the last pixel in
  1936.            the line is drawn, if clear it is not drawn
  1937.         6  Dst_Polygon_En. Enables Polygon Outline & Fill.
  1938.         7  Dst_24_Rot_En. Enables 24bpp Rotation.
  1939.      8-10  Dst_24_Rot. Initial foreground color, background color, write mask
  1940.            and pattern rotation when drawing in 24bit packed mode.
  1941.        11  Dst_Bres_Sign. When the Dst_Bres_Err (M+124h) register is 0, it
  1942.            should be considered as:    0: Positive, 1: Negative
  1943.  
  1944. M+180h D(R/W):  Src_Off_Pitch
  1945. bit  0-19  Src_Offset. Start address of the source area in units of 8 bytes
  1946.     22-31  Src_Pitch. Width of the source area in units of 8 pixels. In mono
  1947.            modes the source width must be a multipla of 64 pixels and in 4bpp
  1948.            modes a multipla of 16 pixels.
  1949.  
  1950. M+184h D(R/W):  Src_X
  1951. bit  0-12  Src_X. Starting X-coordinate of the blit source
  1952. Note: this register can also be written at M+18Ch
  1953.  
  1954. M+188h D(R/W):  Src_Y
  1955. bit  0-14  Src_Y. Starting Y-coordinate of the blit source
  1956. Note: this register can also be written at M+18Ch
  1957.  
  1958. M+18Ch D(W):  Src_Y_X
  1959. bit  0-14  Src_Y. Starting Y-coordinate of the blit source
  1960.     16-28  Src_X. Starting X-coordinate of the blit source
  1961.  
  1962. M+190h D(R/W):  Src_Width1
  1963. bit  0-12  Src_Width1. Width of the pattern in scan lines. For rotated
  1964.            patterns this is the width from the startpoint (inside the
  1965.            pattern) to the end of the pattern. Src_Width2 (M+1A8h) defines
  1966.            the total pattern width. Only used if patterns are enabled (M+1B4h
  1967.            bit 0 is set)
  1968. Note: this register can also be written at M+198h
  1969.  
  1970. M+194h D(R/W):  Src_Height1
  1971. bit  0-14  Src_Height1. Height of the pattern in scan lines. For rotated
  1972.            patterns this is the height from the startpoint (inside the
  1973.            pattern) to the end of the pattern. Src_Height2 (M+1ACh) defines
  1974.            the total pattern height. Only used if patterns are enabled (M+1B4h
  1975.            bit 0 is set)
  1976. Note: this register can also be written at M+198h
  1977.  
  1978. M+198h D(W):  Src_Height1_Width1
  1979. bit  0-14  Src_Height1. Source Pattern Height. See Src_Height1 (M+194h)
  1980.     16-28  Src_Width1. Source Pattern Width. See Src_Width1 (M+190h)
  1981.  
  1982. M+19Ch D(R/W):  Src_X_Start
  1983. bit  0-12  Src_X_Start. For pattern with rotation selects the left edge of the
  1984.            pattern.
  1985. Note: this register can also be written at M+1A4h
  1986.  
  1987. M+1A0h D(R/W):  Src_Y_Start
  1988. bit  0-14  Src_Y_Start. For pattern with rotation selects the top edge of the
  1989.            pattern.
  1990. Note: this register can also be written at M+1A4h
  1991.  
  1992. M+1A4h D(W):  Src_Y_X_Start
  1993. bit  0-14  Src_Y_Start. For pattern with rotation selects the top edge of the
  1994.            pattern.
  1995.     16-28  Src_X_Start. For pattern with rotation selects the left edge of the
  1996.            pattern.
  1997.  
  1998. M+1A8h D(R/W):  Src_Width2
  1999. bit  0-12  Src_Width2. For Pattern with rotation blits defines the total width
  2000.            of the pattern in pixels. Src_Width1 (M+190h) defines the distance
  2001.            from the starting point to the end of the pattern. Only used if
  2002.            patterns with rotation are enabled (M+1B4h bit 0 and 1 both set).
  2003. Note: this register can also be written at M+1B0h
  2004.  
  2005. M+1ACh D(R/W):  Src_Height2
  2006. bit  0-14  Src_Height2. For Pattern with rotation blits defines the total
  2007.            height of the pattern in scanlines. Src_Height1 (M+194h) defines
  2008.            the distance from the starting point to the end of the pattern.
  2009.            Only used if patterns with rotation are enabled (M+1B4h bit 0 and 1
  2010.            both set).
  2011. Note: this register can also be written at M+1B0h
  2012.  
  2013. M+1B0h D(W):  Src_Height2_Width2
  2014. bit  0-14  Src_Height2. Source Pattern Height. See Src_Height1 (M+1ACh)
  2015.     16-28  Src_Width2. Source Pattern Width. See Src_Width2 (M+1A8h).
  2016.  
  2017. M+1B4h D(R/W):  Src_Cntl
  2018. bit     0  Src_Patt_En. Enables the use of patterns if set. Src_Y_End is only
  2019.            used if this bit is set.
  2020.         1  Src_Patt_Rot_En. Enables rotated patterns if set (and bit 0 set).
  2021.            Src_X_Start (M+19Ch) and Src_Y_Start (M+188h) are only used if this
  2022.            bit is set.
  2023.         2  Src_Linear_En. Enables Linear Source, where the source data starts
  2024.            at Src_Offset (M+180h) and advances left-to-right. Dst_X_Dir
  2025.            (M+130h bit 0) should be set. All other source registers are
  2026.            ignored, except Src_Byte_Align (bit 3)
  2027.         3  Src_Byte_Align. If set the source pointer advances to the nearest
  2028.            byte boundary when the destination moves to the next line. Only
  2029.            valid in 1bpp and 4bbp modes with rectangular destination and
  2030.            Linear Source (bit 2) is set.
  2031.         4  Src_Line_X_Dir. Source X direction for Bresenham linedraw
  2032.  
  2033. M+200h - M+23Ch D(W):  Host_Data[]
  2034. bit  0-31  Host_Data. This register is used for transfering Host Source data.
  2035.            There are 16 DWORD addresses mapped to the same register to allow
  2036.            transfer via REP MOVSD. If too little host data is transfered
  2037.            (another drawing engine register is written while the engine still
  2038.            expects host data) the engine panics and completes the operation
  2039.            with garbage data. Any excess data transfered is discarded.
  2040.  
  2041. M+240h D(R/W):  Host_Cntl
  2042. bit     0  Host_Byte_Align. Enables Host Data Byte alignment if set
  2043.  
  2044. M+280h D(R/W):  Pat_Reg0
  2045. bit  0-31  Pat_Reg0. 1st half of the pattern. The other half is in M+284h
  2046.  
  2047. M+284h D(R/W):  Pat_Reg1
  2048. bit  0-31  Pat_Reg1. 2nd half of the pattern. The other half is in M+280h
  2049.  
  2050. M+288h D(R/W):  Pat_Cntl
  2051. bit     0  Pat_Mono_En. Enables mono pattern
  2052.         1  Pat_Clr_4x2_En. Enables 4x2 color pattern
  2053.         2  Pat_Clr_8x1_En. Enables 8x1 color pattern
  2054.  
  2055. M+2A0h D(R/W):  Sc_Left
  2056. bit  0-12  Sc_Left. Left edge of the scissor rectangle. No pixels are drawn
  2057.            to the left of this line.
  2058.  
  2059. M+2A4h D(R/W):  Sc_Right
  2060. bit  0-12  Sc_Right. Right edge of the scissor rectangle. No pixels are drawn
  2061.            to the right of this line.
  2062.  
  2063. M+2A8h D(W):  Sc_Left_Right
  2064. bit  0-12  Sc_Left. Left edge of the scissor rectangle. No pixels are drawn
  2065.            to the left of this line.
  2066.     16-27  Sc_Right. Right edge of the scissor rectangle. No pixels are drawn
  2067.            to the right of this line.
  2068. Note: These registers are also present at M+2A0h and M+2A4h
  2069.  
  2070. M+2ACh D(R/W):  Sc_Top
  2071. bit  0-14  Sc_Top. Top edge of the scissor rectangle. No pixels are drawn
  2072.            above this line.
  2073.  
  2074. M+2B0h D(R/W):  Sc_Bottom
  2075. bit  0-14  Sc_Bottom. Bottom edge of the scissor rectangle. No pixels are
  2076.            drawn below this line.
  2077.  
  2078. M+2B4h D(W):  Sc_Top_Bottom
  2079. bit  0-14  Sc_Top. Top edge of the scissor rectangle. No pixels are drawn
  2080.            above this line.
  2081.     16-30  Sc_Bottom. Bottom edge of the scissor rectangle. No pixels are
  2082.            drawn below this line.
  2083. Note: These registers are also present at M+2ACh and M+2B0h
  2084.  
  2085. M+2C0h D(R/W):  Dp_Bkgd_Clr
  2086. bit  0-31  Dp_Bkgd_Clr. Background color. Only the 1/4/8/16/24/32 lowest bits
  2087.            used depending on the current pixel depth.
  2088.  
  2089. M+2C4h D(R/W):  Dp_Frgd_Clr
  2090. bit  0-31  Dp_Frgd_Clr. Foreground color. The bits needed for the current
  2091.            pixel depth are taken from the low end. I.e. in 4bpp mode only the
  2092.            low 4 birts are used.
  2093.  
  2094. M+2C8h D(R/W):  Dp_Write_Msk
  2095. bit  0-31  Dp_Write_Msk. Write mask. Each 0 bit prevents writing to the
  2096.            corresponding bit in each pixel.
  2097.  
  2098. M+2CCh D(R/W):  Dp_Chain_Mask
  2099. bit  0-14  Dp_Chain_Msk. Defines the breaks between pixels and color blocks.
  2100.            Each set bit prevents the propagation of the corresponding carry
  2101.            bit in the ALU. Only used if the fore- or background mix is set to
  2102.            17h. Should be programmed to the folowing values, depending of the
  2103.            pixel depth:  1bpp: N/A, 4bpp: 8888h, 7bpp (RGB 2:3:2): D2D2h,
  2104.             8bpp: 8080h, 8bpp (RGB 3:3:2): 9292h, 15bpp: 4210h, 16bpp: 8410h,
  2105.             24bpp: 8080h, 32bpp: 8080h
  2106.  
  2107. M+2D0h D(R/W):  Dp_Pix_Width
  2108. bit   0-2  Dp_Dst_Pix_Width. Destination pixel width.
  2109.             0: Mono, 1: 4bpp, 2: 8bpp, 3: 15bpp, 4: 16bpp, 6: 32bpp
  2110.      8-10  Dp_Src_Pix_Width. Source Pixel Width. See above
  2111.     16-18  Dp_Host_Pix_Width. Host Data Pixel Width. See above
  2112.        24  Dp_Byte_Pix_Order. Pixel order within each byte in 1bpp and 4bpp
  2113.            modes. 0: 1st pixel at MSB, 1: 1st pixel at LSB
  2114. Note: The pixel widths should either be the same for all three fields, or for
  2115.       monochrome to color expansion (Src or Host set to mono).
  2116.  
  2117. M+2D4h D(R/W):  Dp_Mix
  2118. bit   0-4  Dp_Bkgd_Mix. Background Mix (see below)
  2119.     16-20  Dp_Fore_Mix. Foreground Mix:
  2120.               00h:  not DST
  2121.               01h:  0 (always false)
  2122.               02h:  1 (always true)
  2123.               03h:  DST
  2124.               04h:  not SRC
  2125.               05h:  DST xor SRC
  2126.               06h:  (not DST) xor SRC
  2127.               07h:  SRC
  2128.               08h:  (not DST) or (not SRC)
  2129.               09h:  DST or (not SRC)
  2130.               0Ah:  (not DST) or SRC
  2131.               0Bh:  DST or SRC
  2132.               0Ch:  DST and SRC
  2133.               0Dh:  (not DST) and SRC
  2134.               0Eh:  DST and (not SRC)
  2135.               0Fh:  (not DST) and (not SRC)
  2136.               17h:  (DST+SRC)/2
  2137.  
  2138. M+2D8h D(R/W):  Dp_Src
  2139. bit   0-2  Dp_Bkgd_Src. Background Source. 0: Background color, 1: Foreground
  2140.            color, 2: Host data, 3: Blit source, 4: Pattern registers
  2141.      8-10  Dp_Frgd_Src. Foreground Source. See above
  2142.     16-17  Dp_Mono_Src. Monochrome Source. 0: Always 1, 1: Pattern registers,
  2143.             2: Host Data, 3: Blit Source
  2144.  
  2145. M+300h D(R/W):  Clr_Cmp_Clr
  2146. bit  0-31  Clr_Cmp_Clr. Color used for color comparison.
  2147.  
  2148. M+304h D(R/W):  Clr_Cmp_Msk.
  2149. bit  0-31  Clr_Cmp_Msk. Color comparison mask
  2150.  
  2151. M+308h D(R/W):  Clr_Cmp_Cntl
  2152. bit   0-2  Clr_Cmp_Fn. Color Comparison function:
  2153.             0: False, 1: True, 4: Diff from Clr_Cmp_Clr, 5: Equal to
  2154.            Clr_Cmp_Clr. If the comparison is false the source data is written
  2155.            to the destination, if true the destination is left untouched.
  2156.        24  Clr_Cmp_Src. Set to compare against the source data, clear to
  2157.            compare against destination data.
  2158.  
  2159. M+310h D(R):  Fifo_Stat
  2160. bit  0-15  Fifo_Stat. FIFO State. Each bit set indicates a filled slot in the
  2161.            command FIFO. Note that only registers from M+100h - M+3FFh use the
  2162.            Command FIFO
  2163.        31  Fifo_Err. FIFO Overrun Error occoured if set. If set the drawing
  2164.            engine is locked until reset through the Gen_Test_Cntl register
  2165.  
  2166. M+320h D(R/W):  Context_Mask
  2167. bit  0-31  Context_Mask. Each bit mask the loading of one DWORD in the context
  2168.            structure. Offset 00h and 70h are loaded regardless of the state of
  2169.            bits 0 and 28 of this register.
  2170.            Context Structure:
  2171.            Bit:   Offset:   Reg Offset:    Register Name:
  2172.              -      00h        320h        Context_Mask
  2173.              2      08h        100h        Dst_Off_Pitch
  2174.              3      0Ch        10Ch        Dst_Y_X
  2175.              4      10h        118h        Dst_Height_Width
  2176.              5      14h        124h        Dst_Bres_Err
  2177.              6      18h        128h        Dst_Bres_Inc
  2178.              7      1Ch        12Ch        Dst_Bres_Dec
  2179.              8      20h        180h        Src_Off_Pitch
  2180.              9      24h        18Ch        Src_Y_X
  2181.             10      28h        198h        Src_Height1_Width1
  2182.             11      2Ch        1A4h        Src_Y_X_Start
  2183.             12      30h        1B0h        Src_Height2_Width2
  2184.             13      34h        280h        Pat_Reg0
  2185.             14      38h        284h        Pat_Reg1
  2186.             15      3Ch        2A8h        Sc_Left_Right
  2187.             16      40h        2B4h        Sc_Top_Bottom
  2188.             17      44h        2C0h        Dp_Bkgd_Clr
  2189.             18      48h        2C4h        Dp_Frgd_Clr
  2190.             19      4Ch        2C8h        Dp_Write_Mask
  2191.             20      50h        2CCh        Dp_Chain_Mask
  2192.             21      54h        2D0h        Dp_Pix_Width
  2193.             22      58h        2D4h        Dp_Mix
  2194.             23      5Ch        2D8h        Dp_Src
  2195.             24      60h        300h        Clr_Cmp_Clr
  2196.             25      64h        304h        Clr_Cmp_Mask
  2197.             26      68h        308h        Clr_Cmp_Cntl
  2198.             27      6Ch        330h        Gui_Traj_Cntl
  2199.              -      70h        32Ch        Context_Load_Cntl
  2200.                 Offset 04h-07h and 74h-FFh Reserved
  2201.  
  2202. M+32Ch D(R/W):  Context_Load_Cntl
  2203. bit  0-14  Context_Load_Ptr. Context Load Pointer in units of 256 bytes from
  2204.            the top of video memory
  2205.     16-17  Context_Load_Cmd. 0. No context load, 1: load from Context_Load_Ptr
  2206.             2: Load from Context_Load_Ptr and start rectangular fill,
  2207.             3: Load from Context_Load_Ptr and start Bresenham line
  2208.        31  Context_Load_Dis. Execute context if set, do not execute if clear
  2209.  
  2210. M+330h D(R/W):  Gui_Traj_Cntl
  2211. bit     0  Dst_X_Dir. Destination X dir. 0: Right to left, 1: Left to right
  2212.         1  Dst_Y_Dir. Destination Y dir. 0: Bottom to top, 1: Top to bottom.
  2213.         2  Dst_Y_Major. Destination Y Major axis (Bresenham linedraw).
  2214.             0: X is major axis, 1: Y is major axis
  2215.         3  Dst_X_Tile. Enable Rectangular tiling in the X direction if set.
  2216.            For rectangular destinations setting this bit causes the Dst_X
  2217.            register to have the value (Dst_X + Dst_Width) after the blit.
  2218.         4  Dst_Y_Tile. Enable Rectangular tiling in the Y direction if set.
  2219.            For rectangular destinations setting this bit causes the Dst_Y
  2220.            register to have the value (Dst_Y + Dst_Height) after the blit.
  2221.         5  Dst_Last_Pel. Enable Destination last Pel. If set the last pixel in
  2222.            the line is drawn, if clear it is not drawn
  2223.         6  Dst_Polygon_En. Enables Polygon Outline & Fill.
  2224.         7  Dst_24_Rot_En. Enables 24bpp Rotation.
  2225.      8-10  Dst_24_Rot. Initial fg color, Bk color, write mask and pattern
  2226.            rotation when drawing in 24bit packed mode.
  2227.        11  Dst_Bres_Sign. When the Dst_Bres_Err (M+124h) register is 0, it
  2228.            should be considered as:    0: Positive, 1: Negative
  2229.        16  Src_Patt_En. Enables Pattern source - Src_Y_End is only used if
  2230.            this bit is ?set?
  2231.        17  Src_Patt_Rot_En. Enables Pattern Source rotation - Src_X_Start and
  2232.            Src_Y_Start are only used if this bit ?set?
  2233.        18  Src_Linear_En. Enables Linear Source Addressing where the source
  2234.            data starts at Src_Offset and continues left to right as a pixel
  2235.            stream. All other source registers and bits are ignored, except bit
  2236.            19. Dst_X_Dir (bit 0 should be set for proper operation.
  2237.        19  Src_Byte_Align. If bit 18 is set, controls whether the source
  2238.            advances to the byte when the destination advances in the Y
  2239.            direction
  2240.        20  Src_Line_X_Dir. Source X direction when for Bresenham Linedraw
  2241.        24  Pat_Mono_En. Enables Monochrome 8x8 Pattern
  2242.        25  Pat_Clr_4x2_En. Enables Color 4x2 Pattern
  2243.        26  Pat_Clr_8x1_En. Enables Color 8x1 Pattern
  2244.        28  Host_Byte_Align. Enables Host Data byte alignment if set
  2245. Note: This register is a combination of the Dst_Cntl (M+130h), Src_Cntl
  2246.       (M+1B4h), Pat_Cntl (M+288h) and Host_Cntl (M+240h) registers.
  2247.  
  2248. M+338h D(R):  Gui_Stat
  2249. bit     0  Gui_Active. Set if the Draing engine is busy
  2250.         8  Dstx_Lt_Scissor_Left. Set if DstX is left of the left scissor
  2251.         9  Dstx_Gt_Scissor_Right. Set if DstX is right of the right scissor
  2252.        10  Dsty_Lt_Scissor_Top. Set if DstX is above the top scissor
  2253.        11  Dsty_Gt_Scissor_Bottom. Set if DstX is below the bottom scissor
  2254.  
  2255.  
  2256. Reserved locations in the ROM (typically starting at C000h:0):
  2257.  
  2258.   $31   9 bytes   '761295520' ID's ATI product
  2259.   $40   2 bytes   '31' = ATI VGA Wonder/Mach series
  2260.   $43   1 byte    Gate revision.
  2261.                    ' ' (20h) = Mach64  (Not documented ??)
  2262.   $64   4 bytes   Far jump to Mach64 BIOS function. AL is the function code,
  2263.                   and the error code is returned in AH (0: Ok, 1: Error,
  2264.                     2: Function not supported).
  2265.                   AL = 00h  Load coprocessor CRTC parameters
  2266.                             CL bit 0-3  Color depth. 1: 4bpp, 2: 8bpp,
  2267.                                          3: 15bpp, 4: 16bpp, 5: 24bp, 6: 32bpp
  2268.                                      4  If set enables gamma correction in
  2269.                                         direct color modes (15bpp and above),
  2270.                                         enables 8bit DAC width in 8bpp modes
  2271.                                         (256 of 16M colors).
  2272.                                    6-7  Pitch. 0: 1024, 1: Don't change,
  2273.                                           2: Same as displayed
  2274.                             CH  Resolution.
  2275.                                  12h:  640x480
  2276.                                  6Ah:  800x600
  2277.                                  55h:  1024x768
  2278.                                  80h:  Load from table at offset BX in EEPROM
  2279.                                  81h:  Load from table at DS:BX
  2280.                                  82h:  OEM mode
  2281.                                  83h:  1280x1024
  2282.                                  84h:  1600x1200
  2283.                   AL = 01h  Set display mode.
  2284.                             CL bit 0  Clear for VGA mode with 6bit DAC, set
  2285.                                       for coprocessort mode
  2286.                                    7  Set for 8bit DAC (8bpp modes) or Gamma
  2287.                                       correction (direct color modes). OR'd
  2288.                                       with bit 4 from the AL=00h function.
  2289.                   AL = 02h  Load coprocessor CRTC parameters and set mode
  2290.                             Same parameters as AL = 00h
  2291.                   AL = 03h  Read EEPROM data
  2292.                             BX  Index into the EEPROM
  2293.                                 Returns data in DX
  2294.                   AL = 04h  Write EEPROM data
  2295.                             BX  Index into the EEPROM
  2296.                             DX  Data
  2297.                   AL = 05h  Memory aperture services
  2298.                             CL bit 0  Set to enable Memory Aperture, clear to
  2299.                                       disable
  2300.                   AL = 06h  Short query function
  2301.                             Returns configuration data:
  2302.                               AL bit 0-5  Aperture configuration
  2303.                                             0: disable, 1: 4M, 2: 8M
  2304.                                        6  Aperture address is predefined or
  2305.                                           hardcoded in BIOS if set, user
  2306.                                           defined if clear
  2307.                                        7  Aperture address is in 4GB range if
  2308.                                           set, in 128MB range if clear
  2309.                               BX  Aperture address
  2310.                               CL  Memory Size
  2311.                               CH  Color Depth support
  2312.                                   bit 0  Set if 15bpp (5-5-5) supported
  2313.                                       1  Set if 16bpp (5-6-5) supported
  2314.                                       2  Set if 24bpp RGB supported
  2315.                                       3  Set if 24bpp BGR supported
  2316.                                       4  Set if 32bpp BGR supported
  2317.                                       5  Set if 32bpp RGBx supported
  2318.                               DX  ASIC identification.
  2319.                                   bit  0-7  Revision
  2320.                                       8-15  Type
  2321.                   AL = 07h  Return hardware capability list
  2322.                             Returns ??
  2323.                   AL = 08h  Return query device data structure in bytes
  2324.                             CL bit 0  Set to return size of header and mode
  2325.                                       tables, clear to return size of header
  2326.                             Returns size (number of bytes) in CX
  2327.                   AL = 09h  Query device
  2328.                             DX:BX  Pointer to buffer to receive data. The
  2329.                                    buffer is filled with first a Query
  2330.                                    structure and then a number of Mode Table
  2331.                                    structures.
  2332.                                CL bit 0  Set to return header and mode tables,
  2333.                                          clear to return header only
  2334.                   AL = 0Ah  Return clock chip frequency table
  2335.                             Returns:
  2336.                                  AL  Clock chip type
  2337.                               DX:BX  Pointer to 16 WORD table of the
  2338.                                      preprogrammed frequencies. Each WORD
  2339.                                      holds one clock in units of 10KHz
  2340.                               DX:CX  Pointer clock chip,info structure:
  2341.                                      Offset Type:
  2342.                                        00h  BYTE  Clock chip type
  2343.                                        01h  BYTE  Frequency table id.
  2344.                                        02h  WORD  Min freq in units of 10KHz
  2345.                                             WORD  Max freq in units of 10KHz
  2346.                                        06h  BYTE  User programmable entry
  2347.                                                   number (if <> FFh)
  2348.                                        07h  BYTE  Reserved
  2349.                                        08h  WORD  Hardware dependant
  2350.                   AL = 0Bh  Program a specified clock entry
  2351.                             CH  Entry in clock table (0-15)
  2352.                             BX  New clock value in units of 10KHz
  2353.                             Returns:
  2354.                               AL = Clock chip type
  2355.                               BX = Programming word (chip dependant)
  2356.                   AL = 0Ch  DPMS service, set DPMS mode
  2357.                             CL  New mode. 0: Active, 1: Standby, 2: Suspend,
  2358.                                  3. Off, 4: Blanking display
  2359.                   AL = 0Dh  Return current DPMS state in CL.
  2360.                             Returns CL = state. 0: Active, 1: Standby,
  2361.                                  2: Suspend, 3. Off, 4: Blanking display
  2362.                   AL = 0Eh  Set graphics controller's power management state
  2363.                             CL  New state. 0: Active, 1: Standby,
  2364.                                  2: Suspend, 3. Off
  2365.                   AL = 0Fh  Return graphics controller's current power
  2366.                             management state in CL.
  2367.                             Returns CL = state.  0: Active, 1: Standby,
  2368.                                  2: Suspend, 3. Off
  2369.                   AL = 10h  Set RAMDAC to different states
  2370.                             CL bit 0  Set to switch RAMDAC to sleep mode,
  2371.                                       clear to switch it to normal mode
  2372.                             Note: CL = 80h is reserved.
  2373.                   AL = 11h  Return external storage device information
  2374.                             CL bit 0-3  Device type
  2375.                                    4-6  External data access mode.
  2376.                                           0: Read- and writable
  2377.                                           1: Readable, not writable
  2378.                                           3: Neither readable or writable
  2379.                                           4: Read- and writable. Access must
  2380.                                              by handled according to the  ??
  2381.                                      7  If set all of external storage is
  2382.                                         used, if clear there is space
  2383.                             Returns:
  2384.                               CL  Last readable and writable entries in the
  2385.                                   storage device
  2386.                               CH  Number of (read only) 16bit entries in the
  2387.                                   storage device
  2388.                               BL  Offset into the CRTC parameter table
  2389.                               BH  Size of the CRTC parameter table
  2390.                   AL = 12h  Short Query. Returns:
  2391.                               DX  I/O base address
  2392.                               AX,BX,CX reserved
  2393.  
  2394.  
  2395. Query structure (returnde by AL = 09h):
  2396. Offset  Size  Description
  2397.   00h   WORD  Size of structure in bytes
  2398.   02h   BYTE  Revision
  2399.   03h   BYTE  Number of mode tables
  2400.   04h   WORD  Offset of mode tables in bytes
  2401.   06h   BYTE  Size of each mode table
  2402.   07h   BYTE  VGA type. 0: Disabled, 1: enabled
  2403.   08h   WORD  ASIC revision
  2404.   0Ah   BYTE  VGA Boundary. 0: full access, 1: 256K, 2: 512K, 3: 768, 4: 1MB
  2405.   0Bh   BYTE  Memory Size. 0: 512K, 1: 1MB, 2: 2MB, 3: 4MB, 4: 6MB, 5: 8MB,
  2406.                6: 12MB, 7: 8MB
  2407.   0Ch   BYTE  Bits 0-3  DAC Type. 2: TI 34075/ATI68875, 3: Bt476/478, 4:
  2408.                 Bt481, AT&T20c490/491, 5: ATI68860, 6: STG1700, 7: STG1702,
  2409.                 SC15021, AT&T20c498
  2410.   0Dh   BYTE  Memory Type. 0: DRAM 256Kx16, 1: VRAM 256Kx4, 2: VRAM 256Kx16,
  2411.                3: DRAM 256Kx4, 5: VRAM 256Kx4 special, 6: VRAM 256Kx16 special
  2412.   0Eh   BYTE  Bus Type. 0: ISA, 1: EISA, 6: VLB, 7: PCI
  2413.   0Fh   BYTE  Bit 6  Enable sync on green
  2414.                   7  Enable composite sync
  2415.   10h   WORD  Aperture address in megabytes (0-4095)
  2416.   12h   BYTE  Aperture configuration.
  2417.               bit 0-5   0: Disable, 1: 4MB, 2: 8MB
  2418.                     6  Aperture address is predefined or hardcoded in BIOS if
  2419.                        set, user defined if clear
  2420.                     7  Aperture address is in 4GB range if set, in 128MB range
  2421.                        if clear
  2422.   13h   BYTE  Color Depth Support.
  2423.               Bit 0  16bpp (5-6-5) modes supported if set
  2424.                   1  15bpp (5-5-5) modes supported if set
  2425.                   2  24bpp (RGB) modes supported if set
  2426.                   3  24bpp (BGR) modes supported if set
  2427.                   4  32bpp (BGR) modes supported if set
  2428.                   5  32bpp (RGBx) modes supported if set
  2429.   14h   BYTE  RAMDAC support feature
  2430.               Bit 4  Supports sleep mode if set
  2431.                   5  Supports 256 grey scale if set
  2432.                   6  Supports gamma correction if set
  2433.                   7  Supports sync on green if set
  2434.   16h   WORD  Offset into current mode table if non-zero
  2435.   18h   WORD  I/O base address
  2436.   1Ah  6BYTEs Reserved
  2437.  
  2438. Mode Table Structure (returned by AL = 09h after the Query structure).
  2439. Offset  Size  Description
  2440.   00h   WORD  Horizontal Display Resolution in pixels
  2441.   02h   WORD  Vertical Display Resolution in scanlines
  2442.   04h   BYTE  Maximum pixel depth. 1: 4bpp, 2: 8bpp, 3: 15bpp, 4: 16bpp,
  2443.                 5: 24bp, 6: 32bpp
  2444.   05h   BYTE  Mode number. 12h:  640x480, 6Ah:  800x600, 55h:  1024x768,
  2445.                82h:  OEM mode, 83h:  1280x1024, 84h:  1600x1200
  2446.   06h   WORD  Offset into EEPROM. Table generated from CRTC parameters if = 0,
  2447.               else this is an index into the EEPROM.
  2448.   0Ch   WORD  Bit 8  Enable doubel scan
  2449.                   9  Enable interlace
  2450.                  10  Enable MUX mode
  2451.   0Eh   BYTE  Crtc_H_Total
  2452.   0Fh   BYTE  Crtc_H_Disp
  2453.   10h   BYTE  Crtc_H_Sync_Strt
  2454.   11h   BYTE  Crtc_H_Sync_Wid
  2455.   12h   WORD  Crtc_V_Total
  2456.   14h   WORD  Crtc_V_Disp
  2457.   16h   WORD  Crtc_V_Sync_Strt
  2458.   18h   BYTE  Crtc_V_Sync_Wid
  2459.   19h   BYTE  Clock_Cntl
  2460.   1Ah   WORD  Dot Clock for coprocessor mode (programmable clock chip)
  2461.   1Ch   WORD  Bits 0-3  Ovr_Wid_Left
  2462.                    4-7  Ovr_Wid_Right
  2463.                   8-11  Crtc_H_Sync_Dly
  2464.                  12-15  Crtc_H_Total_Dly
  2465.   1Eh   WORD  Ovr_Wid_Top, Ovr_Wid_Bottom
  2466.   20h   WORD  Ovr_Clr_B, Ovr_Clr_8
  2467.   22h   WORD  Ovr_Clr_G, Ovr_Clr_R
  2468.  
  2469. EEPROM Data structure. All offsets are in WORDs (16bits).
  2470. Offset  Bits  Description
  2471.   00h   0-15  EEPROM write counter
  2472.   01h    0-7  EEPROM checksum. The (byte) sum of the EEPROM must be 0.
  2473.   02h   0-15  Reserved(0)
  2474.   03h    0-3  EEPROM table revision
  2475.   04h   0-15  Custom monitor indices
  2476.   05h      0  Enable composite sync
  2477.            1  Enable sync on green
  2478.            6  Enable 640x480 at 72Hz if set
  2479.            7  Use stored 640x480 parameters for coprocessor mode if set
  2480.         8-15  1280x1024 refresh rate information
  2481.   06h      0  Select 800x600 at 85Hz interlaced if set
  2482.            1  Select 800x600 at 89Hz interlaced if set
  2483.            2  Select 800x600 at 56Hz if set
  2484.            3  Select 800x600 at 60Hz if set
  2485.            4  Select 800x600 at 70Hz if set
  2486.            5  Select 800x600 at 72Hz if set
  2487.            7  Use stored 800x600 parameters for coprocessor mode if set
  2488.   07h      0  Select 1024x768 at 87Hz interlaced if set
  2489.            1  Select 1024x768 at 60Hz if set
  2490.            2  Select 1024x768 at 70Hz if set
  2491.            3  Select 1024x768 at 72Hz if set
  2492.            7  Use stored 1024x768 parameters for coprocessor mode if set
  2493.   08h      0  16bit ROM enabled if set
  2494.            1  Zero Wait State ROM enabled if set
  2495.            2  Zero Wait State RAM enabled if set
  2496.            3  VGA bus I/O is 16bit if set, 8 bit if clear
  2497.            4  Font selected at power-up. 0: 8x14 or 9x14, 1: 8x16 or 9x16
  2498.            5  Dual monitor enable
  2499.          6-7  Monochrome Mode Color Select. 0: White, 1: Green, 2: Amber
  2500.         8-15  Power-Up Video Mode. 3: VGA color (secondary), 5: VGA mono
  2501.                (secondary), 9: VGA color (primary), 0Bh: VGA mono (primary).
  2502.   09h    0-2  Monitor Alias
  2503.            3  Monitor alias enable
  2504.          4-5  VGA boundary. 0: Full access, 1: 512K, 2: 1MB
  2505.         8-13  Monitor code
  2506.        14-15  Host data transfer width. 0: Auto select, 1: 16 bit, 2: 8bit,
  2507.                3: 8bit (host), 16bit (others)
  2508.   0Ah    0-3  Aperture Size (only used Aperture Location is 0)
  2509.         4-15  Aperture Location in Mbytes
  2510.   0Bh    0-7  Interrupt level. 20h: IRQ 5, 28h: IRQ 4, 30h: IRQ 3, 38h: IRQ 2
  2511.         8-15  Mouse address. 0: Mouse disabled, 8: Secondary mouse address,
  2512.                18h: Primary mouse address
  2513.   0Ch - 16h   Reserved. The (upto) 7 CRTC parameter tables start at offset
  2514.                17h, 26h, 35h, 44h, 53h, 62h and 71h respectively
  2515.  
  2516. CRTC Parameter Table (in EEPROM). All offsets are in WORDs (16bits).
  2517. The tables are different for VGA modes and accelerator modes. Each table is 30
  2518. (1Eh) bytes long
  2519. Offset  Bits  Description (VGA version)
  2520.   00h    0-7  Video mode select 1
  2521.         8-15  Video mode select 2
  2522.   01h    0-7  CRT refresh rate bit mask
  2523.         8-15  Video mode select 3
  2524.   02h      4  CRT usage. 0: Use sync polarities, 1: use all CRT parameters
  2525.            6  Horizontal sync polarity
  2526.            7  Vertical sync polarity
  2527.            8  Double scan enable
  2528.            9  Interlace enable
  2529.           13  MUX mode enable
  2530.   03h    0-7  H_Total (3d4h index 0)
  2531.         8-15  Max_Scan_Line (3d4h index 9)
  2532.   04h    0-7  Retrace_Strt (3d4h index 4)
  2533.         8-15  H_Retrace_End (3d4h index 5)
  2534.   05h    0-7  V_Retrace_Strt (3d4h index 10h)
  2535.         8-15  V_Retrace_End (3d4h index 11h)
  2536.   06h    0-7  H_Blank_Strt (3d4h index 2)
  2537.         8-15  H_Blank_End (3d4h index 3)
  2538.   07h    0-7  V_Blank_Strt (3d4h index 15h)
  2539.         8-15  V_Blank_End (3d4h index 16h)
  2540.   08h    0-7  V_Total (3d4h index 6)
  2541.         8-15  Crtc_Overflow (3d4h index 7)
  2542.   09h    0-7  CRT_Mode (3d4h index 17h)
  2543.         8-15  V_Disp_End (3d4h index 12h)
  2544.   0Ah    0-3  Ovr_Wid_Left
  2545.          4-7  Ovr_Wid_Right
  2546.         8-11  Crtc_H_Sync_Dly
  2547.   0Bh   0-15  Ovr_Wid_Top, Ovr_Wid_Bottom
  2548.   0Ch   0-15  Ovr_Clr_8, Ovr_Clr_B
  2549.   0Dh   0-15  Ovr_Clr_G, Ovr_Clr_R
  2550.   0Eh   0-15  Reserved
  2551.  
  2552.  
  2553. Offset  Bits  Description (Accelerator version)
  2554.   01h    0-7  80h for coprocessor mode
  2555.         8-15  Video mode select
  2556.   02h      8  Double scan enable
  2557.            9  Interlace enable
  2558.           13  MUX mode enable
  2559.   03h    0-7  Crtc_H_Total (M+000h/02ECh bit 0-7)
  2560.         8-15  Crtc_H_Disp (M+000h/02ECh bit 16-23)
  2561.   04h    0-7  Crtc_H_Sync_Strt (M+004h/06ECh bit 0-7)
  2562.         8-15  Crtc_H_Sync_Wid (M+004h/06ECh bit 16-21)
  2563.   05h   0-15  Crtc_V_Total (M+008h/0AECh bit 0-10)
  2564.   06h   0-15  Crtc_V_Disp (M+008h/0AECh bit 16-26)
  2565.   07h   0-15  Crtc_V_Sync_Strt (M+00Ch/0EECh bit 0-10)
  2566.   08h    0-7  Crtc_V_Sync_Width (M+00Ch/0EECh bit 16-21)
  2567.         8-15  Clock_Cntl (M+090h/4AECh bit 0-7)
  2568.   09h   0-15  Dot clock
  2569.   0Ah    0-3  Ovr_Wid_Left (M+044h/26ECh bit 0-3)
  2570.          4-7  Ovr_Wid_Right (M+044h/26ECh bit 16-19)
  2571.         8-11  Crtc_H_Sync_Dly (M+004h/06ECh bit 8-10)
  2572.   0Bh   0-15  Ovr_Wid_Top (M+048h/2AECh bit 0-7), Ovr_Wid_Bottom (M+048h/2AECh
  2573.                bit 16-23)
  2574.   0Ch   0-15  Ovr_Clr_8 (M+040h/22ECh bit 0-7), Ovr_Clr_B (M+040h/22ECh bit
  2575.                8-15)
  2576.   0Dh   0-15  Ovr_Clr_G (M+040h/22ECh bit 16-23), Ovr_Clr_R (M+040h/22ECh bit
  2577.                24-31)
  2578.   0Eh   0-15  Reserved
  2579.  
  2580.  
  2581.  
  2582.   ID ATI Super VGA Chip Set
  2583.  
  2584.   if (getbios($31,9)='761295520') and (getbios($40,2)='31') then
  2585.   begin
  2586.     {ATI_Super_VGA}
  2587.     case mem[$C000:$43] of
  2588.       $31: ATI 18800;
  2589.       $32: ATI 18800-1;
  2590.       $33: ATI 28800-2;
  2591.       $34: ATI 28800-4;
  2592.       $35: ATI 28800-5;
  2593.       $36: ATI 28800-6;
  2594.   $61,$63: ATI Graphics Ultra Pro/+;
  2595.     else unknown_ATI
  2596.     end
  2597.   end;
  2598.  
  2599.  
  2600.   Video Modes:
  2601.     23h  T   132   25  16  (8x14)
  2602.     27h  T   132   25   2  (8x14)
  2603.     33h  T   132   44  16  (8x8)
  2604.     37h  T   132   44   2  (8x8)
  2605.     51h  G   640  480  16  PL4      ATI EGA Wonder only
  2606.     52h  G   752  410  16  PL4      ATI EGA Wonder only
  2607.     53h  G   800  560  16  PL4
  2608.     54h  G   800  600  16  PL4
  2609.     55h  G  1024  768  16  PL4      (V4 or later)
  2610.     58h  T    80   33  16  (8x8)
  2611.     5Bh  T    80   30      (8x16)
  2612.     61h  G   640  400 256  P8
  2613.     62h  G   640  480 256  P8
  2614.     63h  G   800  600 256  P8
  2615.     64h  G  1024  768 256  P8       V6 (VGA Wonder +) or later
  2616.     65h  G  1024  768  16  P4       ****  See note
  2617.     67h  G  1024  768   4  PL2E     ****  See note
  2618.     6Ah  G   800  600  16  PL4      Undocumented ??
  2619.     72h  G   640  480 32k  P15      V7 (XL) only
  2620.     73h  G   800  600 32k  P15      V7 (XL) only
  2621.     75h  G   640  480 16m  P24      XL24 only
  2622.  
  2623. Note: ATI Prism Elite uses a Trident chip and Trident mode numbers.
  2624.  
  2625.     ATI enhanced Graphics modes do NOT support INT 10h with AH=
  2626.       01h..0Eh or 11h or 13h.
  2627.  
  2628.  
  2629.     Mode 65h  1024x768 16 color
  2630.       4 bits per pixel packed mode
  2631.       Even pixel is in bits 0-3 of the byte, odd in bits 4-7.
  2632.       The desired 16 colors are in palette registers 00h-0Fh and palette
  2633.       register 10h must match register 01h, 20h must match 02h etc.
  2634.  
  2635.     Mode 67h  1024x768  4 color
  2636.       2 bits per pixel planar mode
  2637.       Even pixels are in plane 2&3, odd pixels in plane 0&1.
  2638.  
  2639.  
  2640.   BIOS extensions:
  2641.  
  2642. ----------1012--BH55-------------------------
  2643. INT 10 - VIDEO - ALTERNATE FUNC SELECT (ATI,Tatung,Taxan) - ENHANCED FEATURES
  2644.         AH = 12h
  2645.         BH = 55h
  2646.         BL = subfunction
  2647.               00h disabled enhanced features
  2648.               01h enable enhanced features
  2649.               02h get status
  2650. Return:           AL = status flags
  2651.                        bit    3  set if enhanced features enabled
  2652.                        bits 7-5  monitor type
  2653.                                  000 PS/2 mono
  2654.                                  001 PS/2 color
  2655.                                  010 multi-sync
  2656.                                  011 Taxan 650 25kHz
  2657.                                  100 RGB
  2658.                                  101 mono
  2659.                                  110 EGA
  2660.                                  111 Compaq internal
  2661.               03h disable register trapping (CGA emulation)
  2662.               04h enable register trapping
  2663.               05h program mode described by table at ES:BP
  2664.               06h get mode table
  2665.                   AL = video mode
  2666.                   BP = FFFFh  (Known illegal value).
  2667.                   SI = 0000h  (Known illegal value).
  2668. Return:           ES:BP -> table suitable for mode AL (and subfnc BL=05h)
  2669.                   BP = FFFFh on error
  2670. Note: The support for this function on the Mach64 appears to be very limited.
  2671.       Subfunction 06h only supports a few modes, subfunction 02h is not
  2672.       implemented.
  2673.  
  2674.  
  2675. Format of ATI VGA Wonder video mode table:
  2676. Offset  Size     Description
  2677.  00h    BYTE     number of columns
  2678.  01h    BYTE     maximum row (number of rows - 1)
  2679.  02h    BYTE     scan lines per row
  2680.  03h    WORD     video buffer size in bytes
  2681.  05h   4 BYTEs   values for Sequencer registers 1-4
  2682.  09h    BYTE     value for Miscellaneous Output register
  2683.  0Ah   25 BYTEs  values for CRTC registers 00h-18h
  2684.                   00h horizontal total size (chars)
  2685.                   01h horizontal displayed (chars)
  2686.                   02h horizontal sync position (chars)
  2687.                   03h horizontal sync width (chars)
  2688.                   04h vertical total size (char rows)
  2689.                   05h vertical total adjust (scan lines)
  2690.                   06h vertical displayed (char rows)
  2691.                   07h vertical sync position (char rows)
  2692.                   08h interlace mode
  2693.                   09h max scan line in row
  2694.                   0Ah cursor start scan line
  2695.                   0Bh cursor end scan line
  2696.                   0Ch screen memory start (high)
  2697.                   0Dh screen memory start (low)
  2698.                   0Eh cursor address (high)
  2699.                   0Fh cursor address (low)
  2700.                   10h light pen (high)
  2701.                   11h light pen (low)
  2702.  23h   20 BYTEs  default palette (values for Attribute Controller regs
  2703.                  00h-13h)
  2704.  37h   9 BYTEs   values for Graphics Controller registers 00h-08h
  2705. ----------10A0-----------------------------------
  2706. INT 10 - VIDEO - Mach64
  2707.         AH = A0h
  2708.